Refactored Player and PlayerBase ctors

This commit is contained in:
Bokros Bálint 2016-04-25 13:56:41 +02:00
parent 1a23abbe47
commit 7b531fecdd
2 changed files with 9 additions and 3 deletions

View File

@ -8,10 +8,9 @@ public class Player extends PlayerBase {
private Box boxLifted; private Box boxLifted;
public Player(Tile startTile, Direction startDirection) { public Player(String name, Tile startTile, Direction startDirection) {
super(name, startTile, startDirection);
zpmContainer = new ArrayList<>(); zpmContainer = new ArrayList<>();
currentTile = startTile;
facingDirection = startDirection; /* Be lehetne állítani egy defaultot is, nem tudom, mennyire kéne */
} }
public void boxLift() { public void boxLift() {

View File

@ -4,6 +4,13 @@ public class PlayerBase implements Destroyable {
protected Game game; protected Game game;
protected Tile currentTile; protected Tile currentTile;
protected Direction facingDirection; protected Direction facingDirection;
protected String name;
public PlayerBase(String name, Tile startTile, Direction startDirection) {
this.name = name;
currentTile = startTile;
facingDirection = startDirection;
}
public void destroy() { public void destroy() {