33 lines
725 B
Java
33 lines
725 B
Java
package cicaprojekt;
|
|
|
|
public class Wall extends Tile {
|
|
private Stargate sg;
|
|
|
|
public Wall() {
|
|
super();
|
|
}
|
|
|
|
public void spawnStargate(Stargate stargate, Direction direction) {
|
|
if (sg == null)
|
|
sg = stargate;
|
|
else
|
|
return;
|
|
}
|
|
|
|
public void clearStargate() {
|
|
sg = null;
|
|
}
|
|
|
|
public void onEntry(PlayerBase playerBase) {
|
|
if (sg == null) {
|
|
return;
|
|
} else {
|
|
sg.teleport(playerBase.facingDirection);
|
|
}
|
|
}
|
|
|
|
public void onExit(PlayerBase playerBase) throws IllegalStateException {
|
|
throw new IllegalStateException("Hiba! Te hogy kerültél a falba?");
|
|
}
|
|
}
|