implemented PlayerBase.pickZPM() (former pickItem()) callback method
This commit is contained in:
parent
69a2384160
commit
d0d656452c
@ -25,7 +25,7 @@ public class Field extends cicaprojekt.Tile
|
||||
return;
|
||||
playerBase.setCurrentTile(this);
|
||||
if(zpmOnTile != null)
|
||||
playerBase.pickItem();
|
||||
playerBase.pickZPM(this);
|
||||
}
|
||||
|
||||
public void onExit(PlayerBase playerBase) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cicaprojekt;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Player extends PlayerBase{
|
||||
@ -8,6 +9,7 @@ public class Player extends PlayerBase{
|
||||
|
||||
|
||||
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 */
|
||||
}
|
||||
@ -21,7 +23,13 @@ public class Player extends PlayerBase{
|
||||
boxLifted = null;
|
||||
}
|
||||
|
||||
public void shootStargate(Stargate stargate) {
|
||||
@Override
|
||||
public void pickZPM(Tile tile)
|
||||
{
|
||||
zpmContainer.add(tile.getZPMFromTile());
|
||||
}
|
||||
|
||||
public void shootStargate(Stargate stargate) {
|
||||
this.currentTile.getAdjacentTile(facingDirection).spawnStargate(stargate, facingDirection);
|
||||
}
|
||||
}
|
||||
|
@ -6,8 +6,7 @@ public class PlayerBase implements Destroyable{
|
||||
protected Direction facingDirection;
|
||||
|
||||
|
||||
public void destroy() {
|
||||
}
|
||||
public void destroy() {}
|
||||
|
||||
public Tile getCurrentTile() {
|
||||
return currentTile;
|
||||
@ -20,10 +19,12 @@ public class PlayerBase implements Destroyable{
|
||||
public void move(Direction direction) {
|
||||
this.setFacingDirection(direction);
|
||||
Tile tile = this.getCurrentTile().getAdjacentTile(direction);
|
||||
tile.onEntry();
|
||||
tile.onEntry(this);
|
||||
setCurrentTile(tile);
|
||||
}
|
||||
|
||||
public void pickZPM(Tile tile) { /* PlayerBase does not collect ZPM modules */ }
|
||||
|
||||
public void rotateLeft() {
|
||||
switch (facingDirection) {
|
||||
case NORTH:
|
||||
|
Loading…
Reference in New Issue
Block a user