Ready Gate except onEntry and onExit.

This commit is contained in:
muskenum 2016-04-21 23:39:00 +02:00
parent d735d72a78
commit a30cb01cd0

View File

@ -5,22 +5,40 @@ public class Gate extends cicaprojekt.Tile
private boolean open = false;
public void spawnStargate(cicaprojekt.Stargate stargate, Direction direction) {
if(this.open)
adjacentTile.get(direction).spawnStargate(stargate, direction);
return;
Menu.addTab();
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.spawnStargate(" + stargate + direction + ")");
if(this.open) adjacentTile.get(direction).spawnStargate(stargate, direction);
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.spawnStargate()");
Menu.removeTab();
}
public void onEntry() {
Menu.addTab();
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.onEntry()");
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.onEntry()");
Menu.removeTab();
}
public void onExit() {
Menu.addTab();
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.onExit()");
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.onExit()");
Menu.removeTab();
}
public boolean isOpen() {
return open;
Menu.addTab();
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.isOpen()");
return open;
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.isOpen()");
Menu.removeTab();
}
public void setOpen(boolean gateState) {
this.open = gateState;
Menu.addTab();
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.setOpen(" + gateState + ")");
this.open = gateState;
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.setOpen()");
Menu.removeTab();
}
}