From a30cb01cd0a7474b7a899e09b531cf50f9983be5 Mon Sep 17 00:00:00 2001 From: muskenum Date: Thu, 21 Apr 2016 23:39:00 +0200 Subject: [PATCH] Ready Gate except onEntry and onExit. --- cicaprojekt/Gate.java | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/cicaprojekt/Gate.java b/cicaprojekt/Gate.java index dca2109..a3cfaf6 100644 --- a/cicaprojekt/Gate.java +++ b/cicaprojekt/Gate.java @@ -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(); } }