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;
* Created by etouss on 04/01/2016.
*/
public class EntityNotFoundExeption extends Exception {
private static final long serialVersionUID = 1L;
}
......@@ -17,26 +17,16 @@ import java.util.Objects;
* It takes the input from the GUI / AI and transmit it to the GameLoop as Event.
* @author Guerquin Arnaud
*
*It knows extends RelayerEntity
*
*/
public class Relayer extends RelayerEntity{
/**
* the relayer's id
*/
/**
* the character for which the relayer create event
*/
private Character character;
/**
* kill the relayer if true
*/
/**
* the direction the relayer should move the character to
*/
/**
*
*/
private boolean hasTriedToCastAbility = false;
/**
* the chracter's current ability
......@@ -54,14 +44,6 @@ public class Relayer extends RelayerEntity{
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() {
if(direction==Direction.NONE){
stopMove();
......@@ -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() {
end=false;
......
......@@ -4,7 +4,6 @@ import core.event.Event;
import core.event.MoveEvent;
import core.gamestate.Action;
import core.gamestate.Entity;
import core.gamestate.GameContent;
import core.zone.Direction;
import core.zone.Translation;
import gameloop.LocalGameLoop;
......@@ -13,14 +12,27 @@ import gameloop.ServerLoop;
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.
* Relayer is an extension of this now
*/
public class RelayerEntity extends Thread{
/**
* the relayer's id
*/
protected int ID;
/**
* the entity for which the relayer create event
*/
protected Entity character;
/**
* kill the relayer if true
*/
protected boolean end=false;
/**
* the direction the relayer should move the character to
*/
protected Direction direction=Direction.NONE;
public RelayerEntity(){
......@@ -32,7 +44,11 @@ public class RelayerEntity extends Thread{
this.character=Objects.requireNonNull(entity);
}
public int getID(){
/**
* Return the relayer's ID
* @return the relayer's ID
*/
public final int getID(){
return ID;
}
......@@ -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){
direction=dir;
}
/**
* Return the relayer's direction
* @return the relayer's direction
*/
public Direction getDirection(){
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