Gate - finished
This commit is contained in:
parent
cbd196532f
commit
fd64fd9165
@ -4,15 +4,26 @@ public class Gate extends Tile
|
|||||||
{
|
{
|
||||||
private boolean open = false;
|
private boolean open = false;
|
||||||
|
|
||||||
|
public Gate(){
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
public void spawnStargate(Stargate stargate, Direction direction) {
|
public void spawnStargate(Stargate stargate, Direction direction) {
|
||||||
if(this.open) adjacentTile.get(direction).spawnStargate(stargate, direction);
|
if(this.open) adjacentTile.get(direction).spawnStargate(stargate, direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onEntry() {
|
public void onEntry(PlayerBase playerBase) {
|
||||||
|
if(open){
|
||||||
|
playerBase.setCurrentTile(this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onExit() {
|
public void onExit(PlayerBase playerBase) throws IllegalStateException {
|
||||||
|
if(!open){
|
||||||
|
throw new IllegalStateException("Hiba! Te hogy kerültél a csukott ajtóba?");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isOpen() {
|
public boolean isOpen() {
|
||||||
|
Loading…
Reference in New Issue
Block a user