From 0249d177a74775de1db08cd97b63c51f9fb3e696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Mon, 28 Mar 2016 23:32:09 +0200 Subject: [PATCH] fixed echoes in ONeill class. --- cicaprojekt/ONeill.java | 56 +++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/cicaprojekt/ONeill.java b/cicaprojekt/ONeill.java index f73406b..b9a1a43 100644 --- a/cicaprojekt/ONeill.java +++ b/cicaprojekt/ONeill.java @@ -11,48 +11,78 @@ public class ONeill implements Destroyable{ public void destroy() { - System.out.println("ONeill.destroy() hivodott."); + Menu.addTab(); + System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.destroy()"); + System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.destroy()"); + Menu.removeTab(); } - + public cicaprojekt.Tile getCurrentTile() { - System.out.println("ONeill.getCurrentTile() hivodott."); + Menu.addTab(); + System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.getCurrentTile()"); + System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.getCurrentTile()"); + Menu.removeTab(); return currentTile; } public void setCurrentTile(cicaprojekt.Tile newCurrentTile) { - System.out.println("ONeill.setCurrentTile(Tile) hivodott."); + Menu.addTab(); + System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.setCurrentTile()"); + System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.setCurrentTile()"); + Menu.removeTab(); currentTile = newCurrentTile; } public void move(Direction direction) { - System.out.println("ONeill.move(Direction) hivodott."); - setCurrentTile(currentTile.getAdjacentTile(direction)); + Menu.addTab(); + System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Oneill.move(" + direction.name() + ")"); + this.setFacingDirection(direction); + Tile tile = this.getCurrentTile().getAdjacentTile(direction); + tile.onEntry(); + setCurrentTile(tile); + System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "Oneill.move()"); + Menu.removeTab(); } public void boxLift() { - System.out.println("ONeill.boxLift() hivodott."); + Menu.addTab(); + System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.boxLift()"); + System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.boxLift()"); + Menu.removeTab(); boxLifted = (Box) currentTile.getAdjacentTile(facingDirection).removeItemFromTile(); } public void boxDrop() { - System.out.println("ONeill.boxDrop() hivodott."); + 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; } public Direction getFacingDirection() { - System.out.println("ONeill.getFacingDirection() hivodott."); + Menu.addTab(); + System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.getFacingDirection()"); + System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.getFacingDirection()"); + Menu.removeTab(); return facingDirection; } public void setFacingDirection(Direction direction) { - System.out.println("ONeill.setFacingDirection() hivodott."); + Menu.addTab(); + System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.setFacingDirection(" + direction.name() + ")"); + System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.setFacingDirection()"); + Menu.removeTab(); facingDirection = direction; } - public void shootStargate(cicaprojekt.Stargate stargate) { - System.out.println("ONeill.shootStargate(Stargate) hivodott."); - currentTile.getAdjacentTile(facingDirection).spawnStargate(stargate, facingDirection); + public void shootStargate(Stargate stargate) { + Menu.addTab(); + System.out.println(">" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.shootStargate(stargate)"); + this.currentTile.getAdjacentTile(facingDirection).spawnStargate(stargate, facingDirection); + System.out.println("<" + "[" + ":" + this.getClass().getSimpleName() + "]" + Menu.tabulator + "ONeill.shootStargate()"); + Menu.removeTab(); } }