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; private boolean open = false;
public void spawnStargate(cicaprojekt.Stargate stargate, Direction direction) { public void spawnStargate(cicaprojekt.Stargate stargate, Direction direction) {
if(this.open) Menu.addTab();
adjacentTile.get(direction).spawnStargate(stargate, direction); System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.spawnStargate(" + stargate + direction + ")");
return; if(this.open) adjacentTile.get(direction).spawnStargate(stargate, direction);
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.spawnStargate()");
Menu.removeTab();
} }
public void onEntry() { 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() { 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() { public boolean isOpen() {
Menu.addTab();
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.isOpen()");
return open; return open;
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.isOpen()");
Menu.removeTab();
} }
public void setOpen(boolean gateState) { public void setOpen(boolean gateState) {
Menu.addTab();
System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.setOpen(" + gateState + ")");
this.open = gateState; this.open = gateState;
System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.setOpen()");
Menu.removeTab();
} }
} }