cicaprojekt/cicaprojekt/Player.java
2016-04-25 13:56:41 +02:00

34 lines
902 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(String name, Tile startTile, Direction startDirection) {
super(name, startTile, startDirection);
zpmContainer = new ArrayList<>();
}
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);
}
}