attribute boolean destroyed and its getter added to PlayerBase

This commit is contained in:
ericnerdo 2016-04-26 00:44:47 +02:00
parent e9303c68e4
commit b37606b86f

View File

@ -5,11 +5,13 @@ public class PlayerBase implements Destroyable {
protected Tile currentTile;
protected Direction facingDirection;
protected String name;
protected boolean destroyed;
public PlayerBase(String name, Tile startTile, Direction startDirection) {
this.name = name;
currentTile = startTile;
facingDirection = startDirection;
destroyed = false;
}
@Override
@ -18,6 +20,7 @@ public class PlayerBase implements Destroyable {
}
public void destroy() {
destroyed = true;
}
public Tile getCurrentTile() {
@ -78,4 +81,8 @@ public class PlayerBase implements Destroyable {
public void setFacingDirection(Direction direction) {
facingDirection = direction;
}
public boolean isDestroyed(){
return destroyed;
}
}