cicaprojekt/cicaprojekt/Wall.java
Bokros Bálint f6bef6fdde Implemented Stargate spawning correctly
Or at least attemted to
2016-04-26 01:09:49 +02:00

40 lines
867 B
Java

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