35 lines
989 B
Java
35 lines
989 B
Java
package cicaprojekt;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
public class Player extends PlayerBase {
|
|
private List<ZPM> zpmContainer;
|
|
private Box boxLifted;
|
|
|
|
|
|
public Player(Tile startTile, Direction startDirection) {
|
|
zpmContainer = new ArrayList<>();
|
|
currentTile = startTile;
|
|
facingDirection = startDirection; /* Be lehetne állítani egy defaultot is, nem tudom, mennyire kéne */
|
|
}
|
|
|
|
public void boxLift() {
|
|
boxLifted = (Box) currentTile.getAdjacentTile(facingDirection).getABox();
|
|
}
|
|
|
|
public void boxDrop() {
|
|
currentTile.getAdjacentTile(facingDirection).putABox(boxLifted);
|
|
boxLifted = null;
|
|
}
|
|
|
|
@Override
|
|
public void pickZPM(Tile tile) {
|
|
zpmContainer.add(tile.getZPMFromTile());
|
|
}
|
|
|
|
public void shootStargate(Stargate stargate) {
|
|
this.currentTile.getAdjacentTile(facingDirection).spawnStargate(stargate, facingDirection);
|
|
}
|
|
}
|