Commit 88d6bf09 authored by Theodore Lopez's avatar Theodore Lopez

comment and last modifications about relayers

parent 91c68cf6
...@@ -7,5 +7,6 @@ package core.gamestate; ...@@ -7,5 +7,6 @@ package core.gamestate;
* Created by etouss on 04/01/2016. * Created by etouss on 04/01/2016.
*/ */
public class EntityNotFoundExeption extends Exception { public class EntityNotFoundExeption extends Exception {
private static final long serialVersionUID = 1L;
} }
...@@ -17,26 +17,16 @@ import java.util.Objects; ...@@ -17,26 +17,16 @@ import java.util.Objects;
* It takes the input from the GUI / AI and transmit it to the GameLoop as Event. * It takes the input from the GUI / AI and transmit it to the GameLoop as Event.
* @author Guerquin Arnaud * @author Guerquin Arnaud
* *
*It knows extends RelayerEntity
*
*/ */
public class Relayer extends RelayerEntity{ public class Relayer extends RelayerEntity{
/**
* the relayer's id
*/
/**
* the character for which the relayer create event
*/
private Character character; private Character character;
/**
* kill the relayer if true
*/
/**
* the direction the relayer should move the character to
*/
/**
*
*/
private boolean hasTriedToCastAbility = false; private boolean hasTriedToCastAbility = false;
/** /**
* the chracter's current ability * the chracter's current ability
...@@ -54,14 +44,6 @@ public class Relayer extends RelayerEntity{ ...@@ -54,14 +44,6 @@ public class Relayer extends RelayerEntity{
this.character=(Character)Objects.requireNonNull(character); this.character=(Character)Objects.requireNonNull(character);
} }
/**
* Return the relayer's ID
* @return the relayer's ID
*/
public final int getID(){
return ID;
}
private void applyMove() { private void applyMove() {
if(direction==Direction.NONE){ if(direction==Direction.NONE){
stopMove(); stopMove();
...@@ -119,28 +101,6 @@ public class Relayer extends RelayerEntity{ ...@@ -119,28 +101,6 @@ public class Relayer extends RelayerEntity{
} }
/**
* Change the direction the relayer will move to.
* @param dir the new direction.
*/
public void move(Direction dir){
direction=dir;
}
/**
* Return the relayer's direction
* @return the relayer's direction
*/
public Direction getDirection(){
return direction;
}
/**
* Stop the thread.
*/
public void kill() {
end=true;
}
public void reset() { public void reset() {
end=false; end=false;
......
...@@ -4,7 +4,6 @@ import core.event.Event; ...@@ -4,7 +4,6 @@ import core.event.Event;
import core.event.MoveEvent; import core.event.MoveEvent;
import core.gamestate.Action; import core.gamestate.Action;
import core.gamestate.Entity; import core.gamestate.Entity;
import core.gamestate.GameContent;
import core.zone.Direction; import core.zone.Direction;
import core.zone.Translation; import core.zone.Translation;
import gameloop.LocalGameLoop; import gameloop.LocalGameLoop;
...@@ -13,14 +12,27 @@ import gameloop.ServerLoop; ...@@ -13,14 +12,27 @@ import gameloop.ServerLoop;
import java.util.Objects; import java.util.Objects;
/** /**
* A simpler version of the powerful Relayer made in order to match the entity instead of character * A simpler version of theRelayer made in order to match the entity instead of character
* -It allow entity to move, smoothly at each refresh of the gamestate. * -It allow entity to move, smoothly at each refresh of the gamestate.
* Relayer is an extension of this now
*/ */
public class RelayerEntity extends Thread{ public class RelayerEntity extends Thread{
/**
* the relayer's id
*/
protected int ID; protected int ID;
/**
* the entity for which the relayer create event
*/
protected Entity character; protected Entity character;
/**
* kill the relayer if true
*/
protected boolean end=false; protected boolean end=false;
/**
* the direction the relayer should move the character to
*/
protected Direction direction=Direction.NONE; protected Direction direction=Direction.NONE;
public RelayerEntity(){ public RelayerEntity(){
...@@ -32,7 +44,11 @@ public class RelayerEntity extends Thread{ ...@@ -32,7 +44,11 @@ public class RelayerEntity extends Thread{
this.character=Objects.requireNonNull(entity); this.character=Objects.requireNonNull(entity);
} }
public int getID(){ /**
* Return the relayer's ID
* @return the relayer's ID
*/
public final int getID(){
return ID; return ID;
} }
...@@ -67,10 +83,18 @@ public class RelayerEntity extends Thread{ ...@@ -67,10 +83,18 @@ public class RelayerEntity extends Thread{
} }
/**
* Change the direction the relayer will move to.
* @param dir the new direction.
*/
public void move(Direction dir){ public void move(Direction dir){
direction=dir; direction=dir;
} }
/**
* Return the relayer's direction
* @return the relayer's direction
*/
public Direction getDirection(){ public Direction getDirection(){
return direction; return direction;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment