From 2afe3cda15cf9b66b62e7fef3882884b30eb4b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Mon, 28 Mar 2016 23:47:40 +0200 Subject: [PATCH] added echoes to Gate class --- cicaprojekt/Gate.java | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/cicaprojekt/Gate.java b/cicaprojekt/Gate.java index e19f59e..fe4d2f6 100644 --- a/cicaprojekt/Gate.java +++ b/cicaprojekt/Gate.java @@ -2,25 +2,48 @@ package cicaprojekt; public class Gate extends cicaprojekt.Tile { - private boolean open; 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); + Menu.removeTab(); + } 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() { + 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; } 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; } }