diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-02-18 09:56:57 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-02-18 09:56:57 +0100 |
commit | 241251019e43daa6170c497e90688f8f104c2f20 (patch) | |
tree | 9cb97262330d10b705c8f9eff028b3abf7c759cb /core | |
parent | 7c09767469ca69ebac47e2753da8d31bba585d44 (diff) | |
download | RustAndDust-241251019e43daa6170c497e90688f8f104c2f20.zip RustAndDust-241251019e43daa6170c497e90688f8f104c2f20.tar.gz |
Attack: cleanup Pawn.engagement->Pawn.attack
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Attack.java | 14 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 10 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Unit.java | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Attack.java b/core/src/ch/asynk/tankontank/engine/Attack.java index 2ec5e09..6bdc9af 100644 --- a/core/src/ch/asynk/tankontank/engine/Attack.java +++ b/core/src/ch/asynk/tankontank/engine/Attack.java @@ -2,20 +2,20 @@ package ch.asynk.tankontank.engine; public class Attack { - Pawn assaulter; - Pawn target; - int distance; - boolean isClear; - boolean isFlank; + public Pawn attacker; + public Pawn target; + public int distance; + public boolean isClear; + public boolean isFlank; public String toString() { - return "engage : " + assaulter + " " + target + " distance:" + distance + " clear:" + isClear + " flank:" + isFlank; + return String.format("attack : %s -> %s dist:%d clear:%b flank:%b", attacker, target, distance, isClear, isFlank); } public void reset() { - assaulter = null; + attacker = null; target = null; distance = 0;; isClear = false; diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index f609fb9..00965b3 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -39,7 +39,7 @@ public abstract class Pawn implements Moveable, Disposable protected String descr; private Sprite sprite; private StackedImages overlays; - protected Attack engagement; + protected Attack attack; protected Move move; public abstract int getMovementPoints(); @@ -73,8 +73,8 @@ public abstract class Pawn implements Moveable, Disposable this.prevTile = null; this.position = new Vector3(0f, 0f, 0f); this.prevPosition = new Vector3(0f, 0f, 0f); - this.engagement = new Attack(); - this.engagement.assaulter = this; + this.attack = new Attack(); + this.attack.attacker = this; } public Pawn(Faction faction, String name, TextureAtlas pawns, TextureAtlas overlays) @@ -105,7 +105,7 @@ public abstract class Pawn implements Moveable, Disposable public void reset() { - engagement.reset(); + attack.reset(); if (move != null) { move.dispose(); move = null; @@ -166,7 +166,7 @@ public abstract class Pawn implements Moveable, Disposable public boolean isFlankAttack() { - return (engagement.isClear && engagement.isFlank); + return (attack.isClear && attack.isFlank); } public Tile getTile() diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java index ff373b0..da02287 100644 --- a/core/src/ch/asynk/tankontank/game/Unit.java +++ b/core/src/ch/asynk/tankontank/game/Unit.java @@ -315,7 +315,7 @@ public class Unit extends HeadedPawn @Override public void engage() { - TankOnTank.debug(engagement.toString()); + TankOnTank.debug(attack.toString()); hasFired = true; updateOverlays(); } |