diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-06 10:39:35 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-06 10:39:35 +0100 |
commit | 21592b3cf4f0904d2d3b7a70a95d76bcca6dcf69 (patch) | |
tree | 29452cae7bc7c936e50c38d31349379627a6ab8a /core/src/ch/asynk/tankontank/game | |
parent | 41746c8d9ceb4313af60ae92697f63897e4acbb7 (diff) | |
download | RustAndDust-21592b3cf4f0904d2d3b7a70a95d76bcca6dcf69.zip RustAndDust-21592b3cf4f0904d2d3b7a70a95d76bcca6dcf69.tar.gz |
add TankOnTank.debug(...)
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
9 files changed, 27 insertions, 17 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java index cc724fb..25e4e62 100644 --- a/core/src/ch/asynk/tankontank/game/Ctrl.java +++ b/core/src/ch/asynk/tankontank/game/Ctrl.java @@ -88,7 +88,6 @@ public class Ctrl implements Disposable public void setAnimationCount(int count) { animationCount = count; - System.err.println(" setAnimationCount(" + count + ")"); } public void animationDone() @@ -97,14 +96,14 @@ public class Ctrl implements Disposable if (animationCount == 0) state.done(); if (animationCount < 0) - System.err.println(" animationCount < 0"); + TankOnTank.debug(" animationCount < 0"); } private void nextPlayer() { player.turnEnd(); if (battle.checkVictory(this)) { - System.err.println("TODO " + player + " has won !!!!!!!!!!!"); + TankOnTank.debug("TODO " + player + " has won !!!!!!!!!!!"); } Player tmp = player; player = opponent; @@ -140,7 +139,7 @@ public class Ctrl implements Disposable hud.changeState(stateType, state); this.state.leave(state); - System.err.println(" switch to : " + state + " " + normal); + TankOnTank.debug(" switch to : " + state + " " + normal); switch(state) { case SELECT: this.state = selectState; diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 351fd46..8e5f893 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -204,7 +204,7 @@ public abstract class Map extends Board public void revertMoves() { - System.err.println(" revertMoves()"); + TankOnTank.debug(" revertMoves()"); for (Pawn pawn : activatedPawns) { revertLastPawnMove(pawn, notifyDoneAnimation(pawn)); } @@ -232,7 +232,7 @@ public abstract class Map extends Board private void animationDone() { - System.err.println("animation done"); + TankOnTank.debug("animation done"); if (soundId >= 0) addAnimation( SoundAnimation.get(SoundAnimation.Action.FADE_OUT, sound, soundId, 0.5f)); soundId = -1; @@ -263,7 +263,7 @@ public abstract class Map extends Board int def = target.getTile().defenseFor(pawn, target, activatedPawns); success = ((dice + activatedUnits + flankAttacks) >= def); } - System.err.println(pawn + " attacks " + target + " : " + pawn.attack.calculus); + TankOnTank.debug(pawn + " attacks " + target + " : " + pawn.attack.calculus); AnimationSequence seq = AnimationSequence.get(2); if (success) { diff --git a/core/src/ch/asynk/tankontank/game/Player.java b/core/src/ch/asynk/tankontank/game/Player.java index e484749..2a6e5a9 100644 --- a/core/src/ch/asynk/tankontank/game/Player.java +++ b/core/src/ch/asynk/tankontank/game/Player.java @@ -46,7 +46,7 @@ public class Player extends ch.asynk.tankontank.engine.Player public void burnDownOneAp() { apSpent += 1; - if (apSpent > actionPoints) System.err.println("ERROR: spent too much AP, please report"); + if (apSpent > actionPoints) TankOnTank.debug("ERROR: spent too much AP, please report"); } @Override diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java index 1bccde9..3e5052e 100644 --- a/core/src/ch/asynk/tankontank/game/Unit.java +++ b/core/src/ch/asynk/tankontank/game/Unit.java @@ -8,6 +8,8 @@ import ch.asynk.tankontank.engine.Tile; import ch.asynk.tankontank.engine.HeadedPawn; import ch.asynk.tankontank.engine.Orientation; +import ch.asynk.tankontank.TankOnTank; + public class Unit extends HeadedPawn { public static final int MOVE = 0; @@ -200,8 +202,8 @@ public class Unit extends HeadedPawn @Override public void move() { - System.err.println(move.toString()); - if (move.cost > mpLeft) System.err.println("ERROR: Movement point exceeded: " + move.cost + "/" + mpLeft + " please report"); + TankOnTank.debug(move.toString()); + if (move.cost > mpLeft) TankOnTank.debug("ERROR: Movement point exceeded: " + move.cost + "/" + mpLeft + " please report"); if (!move.entryMove) { hasMoved = true; @@ -212,7 +214,7 @@ public class Unit extends HeadedPawn @Override public void attack() { - System.err.println(attack.toString()); + TankOnTank.debug(attack.toString()); hasFired = true; } diff --git a/core/src/ch/asynk/tankontank/game/hud/Msg.java b/core/src/ch/asynk/tankontank/game/hud/Msg.java index 5eb3c5c..765a429 100644 --- a/core/src/ch/asynk/tankontank/game/hud/Msg.java +++ b/core/src/ch/asynk/tankontank/game/hud/Msg.java @@ -2,12 +2,13 @@ package ch.asynk.tankontank.game.hud; import java.util.ArrayDeque; -import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds; +import ch.asynk.tankontank.TankOnTank; + public class Msg extends Bg { class MsgInfo @@ -114,7 +115,7 @@ public class Msg extends Bg visible = false; if (stack.size() > 0) { MsgInfo info = stack.pop(); - System.err.println(info); + TankOnTank.debug(info.text); write(info.text, info.duration, info.position); } } diff --git a/core/src/ch/asynk/tankontank/game/states/StateAttack.java b/core/src/ch/asynk/tankontank/game/states/StateAttack.java index 20243a9..80c240b 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateAttack.java +++ b/core/src/ch/asynk/tankontank/game/states/StateAttack.java @@ -2,6 +2,8 @@ package ch.asynk.tankontank.game.states; import ch.asynk.tankontank.game.Unit; +import ch.asynk.tankontank.TankOnTank; + public class StateAttack extends StateCommon { @Override @@ -26,7 +28,7 @@ public class StateAttack extends StateCommon selectedUnit.showAttack(); map.selectHex(selectedHex); } else - System.err.println("should not happen"); + TankOnTank.debug("should not happen"); } @Override diff --git a/core/src/ch/asynk/tankontank/game/states/StateBreak.java b/core/src/ch/asynk/tankontank/game/states/StateBreak.java index ac7aea4..fa3023f 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateBreak.java +++ b/core/src/ch/asynk/tankontank/game/states/StateBreak.java @@ -3,6 +3,8 @@ package ch.asynk.tankontank.game.states; import ch.asynk.tankontank.engine.Orientation; import ch.asynk.tankontank.game.Unit; +import ch.asynk.tankontank.TankOnTank; + public class StateBreak extends StateCommon { private boolean done; @@ -82,6 +84,6 @@ public class StateBreak extends StateCommon ctrl.setAnimationCount(1); ctrl.setState(StateType.ANIMATION); } else - System.err.println("That's very wrong there should be only one path"); + TankOnTank.debug("That's very wrong there should be only one path"); } } diff --git a/core/src/ch/asynk/tankontank/game/states/StateCommon.java b/core/src/ch/asynk/tankontank/game/states/StateCommon.java index cb89b82..9bf6ac7 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateCommon.java +++ b/core/src/ch/asynk/tankontank/game/states/StateCommon.java @@ -6,6 +6,8 @@ import ch.asynk.tankontank.game.Unit; import ch.asynk.tankontank.game.Ctrl; import ch.asynk.tankontank.game.State; +import ch.asynk.tankontank.TankOnTank; + public abstract class StateCommon implements State { protected static Ctrl ctrl; @@ -98,7 +100,7 @@ public abstract class StateCommon implements State isEnemy = ctrl.player.isEnemy(selectedUnit); else isEnemy = false; - System.err.println(" select " + selectedHex + selectedUnit + (isEnemy ? " enemy " : " friend ")); + TankOnTank.debug(" select " + selectedHex + selectedUnit + (isEnemy ? " enemy " : " friend ")); } protected void showPossibleTargetsMovesAssists(Unit pawn) diff --git a/core/src/ch/asynk/tankontank/game/states/StateRotate.java b/core/src/ch/asynk/tankontank/game/states/StateRotate.java index 1b682c8..b35a856 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateRotate.java +++ b/core/src/ch/asynk/tankontank/game/states/StateRotate.java @@ -2,6 +2,8 @@ package ch.asynk.tankontank.game.states; import ch.asynk.tankontank.engine.Orientation; +import ch.asynk.tankontank.TankOnTank; + public class StateRotate extends StateCommon { private boolean rotateOnly; @@ -23,7 +25,7 @@ public class StateRotate extends StateCommon to = activeUnit.getHex(); } else { if (to == null) - System.err.println("to is null but should not be"); + TankOnTank.debug("to is null but should not be"); map.showFinalPath(to); } |