attribute boolean destroyed and its getter added to PlayerBase
This commit is contained in:
parent
e9303c68e4
commit
b37606b86f
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user