diff --git a/cicaprojekt/Gate.java b/cicaprojekt/Gate.java index fe4d2f6..49aeee9 100644 --- a/cicaprojekt/Gate.java +++ b/cicaprojekt/Gate.java @@ -7,13 +7,11 @@ public class Gate extends cicaprojekt.Tile public void spawnStargate(cicaprojekt.Stargate stargate, Direction direction) { 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; + System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Gate.spawnStargate()"); + Menu.removeTab(); + return; } public void onEntry() { @@ -41,9 +39,9 @@ public class Gate extends cicaprojekt.Tile public void setOpen(boolean 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(); - this.open = gateState; } } diff --git a/cicaprojekt/ONeill.java b/cicaprojekt/ONeill.java index b9a1a43..8922a19 100644 --- a/cicaprojekt/ONeill.java +++ b/cicaprojekt/ONeill.java @@ -28,9 +28,9 @@ public class ONeill implements Destroyable{ public void setCurrentTile(cicaprojekt.Tile newCurrentTile) { Menu.addTab(); System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.setCurrentTile()"); + currentTile = newCurrentTile; System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.setCurrentTile()"); Menu.removeTab(); - currentTile = newCurrentTile; } public void move(Direction direction) { @@ -56,10 +56,10 @@ public class ONeill implements Destroyable{ public void boxDrop() { Menu.addTab(); System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.boxDrop()"); - System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.boxDrop()"); - Menu.removeTab(); currentTile.getAdjacentTile(facingDirection).setItemOnTile(boxLifted); boxLifted = null; + System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.boxDrop()"); + Menu.removeTab(); } public Direction getFacingDirection() { @@ -73,9 +73,9 @@ public class ONeill implements Destroyable{ public void setFacingDirection(Direction direction) { Menu.addTab(); System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.setFacingDirection(" + direction.name() + ")"); + facingDirection = direction; System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.setFacingDirection()"); Menu.removeTab(); - facingDirection = direction; } public void shootStargate(Stargate stargate) { diff --git a/cicaprojekt/Scale.java b/cicaprojekt/Scale.java index 183499d..09e8460 100644 --- a/cicaprojekt/Scale.java +++ b/cicaprojekt/Scale.java @@ -6,24 +6,24 @@ public class Scale extends Field { public void onEntry() { Menu.addTab(); System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Scale.onEntry()"); + gateConnected.setOpen(true); System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Scale.onEntry()"); Menu.removeTab(); - gateConnected.setOpen(true); } public void onExit() { Menu.addTab(); System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Scale.onExit()"); - System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Scale.onExit()"); gateConnected.setOpen(false); + System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Scale.onExit()"); Menu.removeTab(); } public void spawnStargate(cicaprojekt.Stargate stargate, Direction direction) { Menu.addTab(); System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Scale.spawnStarGate(stargate," + direction.name() + ")"); - System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Scale.spawnStarGate()"); adjacentTile.get(direction).spawnStargate(stargate, direction); + System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Scale.spawnStarGate()"); Menu.removeTab(); } }