diff --git a/cicaprojekt/Player.java b/cicaprojekt/Player.java index d58eed6..472f8df 100644 --- a/cicaprojekt/Player.java +++ b/cicaprojekt/Player.java @@ -8,10 +8,9 @@ public class Player extends PlayerBase { private Box boxLifted; - public Player(Tile startTile, Direction startDirection) { + public Player(String name, Tile startTile, Direction startDirection) { + super(name, startTile, startDirection); zpmContainer = new ArrayList<>(); - currentTile = startTile; - facingDirection = startDirection; /* Be lehetne állítani egy defaultot is, nem tudom, mennyire kéne */ } public void boxLift() { diff --git a/cicaprojekt/PlayerBase.java b/cicaprojekt/PlayerBase.java index 5162c8a..1b8b46b 100644 --- a/cicaprojekt/PlayerBase.java +++ b/cicaprojekt/PlayerBase.java @@ -4,6 +4,13 @@ public class PlayerBase implements Destroyable { protected Game game; protected Tile currentTile; protected Direction facingDirection; + protected String name; + + public PlayerBase(String name, Tile startTile, Direction startDirection) { + this.name = name; + currentTile = startTile; + facingDirection = startDirection; + } public void destroy() {