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