added echoes to Gate class

This commit is contained in:
Kjistóf 2016-03-28 23:47:40 +02:00
parent 0249d177a7
commit 2afe3cda15

View File

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