cicaprojekt/cicaprojekt/Player.java
2016-04-24 23:01:34 +02:00

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);
}
}