diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-14 12:50:29 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-14 12:50:29 +0100 |
commit | 953e31e257dd6b3ed3595cc5b90dd13fdbf6e39c (patch) | |
tree | 50f5f25ce78829ba62f3dc12356dcd13514fd033 /core/src/ch/asynk/tankontank/engine | |
parent | 734c79b736a177b4f4418ad360d57a0e004a7f7e (diff) | |
download | RustAndDust-953e31e257dd6b3ed3595cc5b90dd13fdbf6e39c.zip RustAndDust-953e31e257dd6b3ed3595cc5b90dd13fdbf6e39c.tar.gz |
Naming attack -> engagement - move -> movement
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 8 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 36 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/PossiblePaths.java | 12 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/SearchBoard.java | 16 |
4 files changed, 36 insertions, 36 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index 1b621c0..0d8f3dc 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -307,7 +307,7 @@ public abstract class Board implements Disposable targets.clear(); while (units.hasNext()) { Pawn target = units.next(); - if (pawn.canAttack(target) && searchBoard.collectAttacks(pawn, target, true)) + if (pawn.canEngage(target) && searchBoard.collectAttacks(pawn, target, true)) targets.add(target); } @@ -337,7 +337,7 @@ public abstract class Board implements Disposable assists.clear(); while (units.hasNext()) { Pawn p = units.next(); - if ((p != pawn) && p.canAttack(target) && searchBoard.collectAttacks(p, target, !p.canAssistAttackWithoutLos())) + if ((p != pawn) && p.canEngage(target) && searchBoard.collectAttacks(p, target, !p.canAssistEngagementWithoutLos())) assists.add(p); } @@ -418,7 +418,7 @@ public abstract class Board implements Disposable return RunnableAnimation.get(pawn, new Runnable() { @Override public void run() { - setPawnOnto(pawn, pawn.move.to, pawn.move.orientation); + setPawnOnto(pawn, pawn.movement.to, pawn.movement.orientation); } }); } @@ -438,7 +438,7 @@ public abstract class Board implements Disposable protected void rotatePawn(final Pawn pawn, Orientation o, RunnableAnimation whenDone) { - pawn.move.setRotation(pawn.getTile(), o); + pawn.movement.setRotation(pawn.getTile(), o); removePawn(pawn); AnimationSequence seq = pawn.getRotateAnimation(o.r(), 2); diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index b9fa335..423824b 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -25,7 +25,7 @@ public abstract class Pawn implements Moveable, Disposable { } - public class Attack + public class Engagement { Pawn target; int distance; @@ -35,7 +35,7 @@ public abstract class Pawn implements Moveable, Disposable public String toString() { - return "attack : " + target + " distance:" + distance + " clear:" + isClear + " flank:" + isFlank + " " + calculus; + return "engage : " + target + " distance:" + distance + " clear:" + isClear + " flank:" + isFlank + " " + calculus; } public void reset() @@ -47,7 +47,7 @@ public abstract class Pawn implements Moveable, Disposable } } - public class Move + public class Movement { Tile from; Tile to; @@ -101,14 +101,14 @@ public abstract class Pawn implements Moveable, Disposable protected String descr; private Image image; private StackedImages overlays; - public Attack attack = new Attack(); - public Move move = new Move(); + public Engagement engagement = new Engagement(); + public Movement movement= new Movement(); public abstract int getMovementPoints(); public abstract int getRoadMarchBonus(); public abstract int getAngleOfAttack(); public abstract int getFlankSides(); - public abstract int getAttackRangeFrom(Tile tile); + public abstract int getEngagementRangeFrom(Tile tile); public abstract boolean isUnit(); public abstract boolean isA(PawnType type); @@ -118,12 +118,12 @@ public abstract class Pawn implements Moveable, Disposable public abstract boolean canMove(); public abstract boolean canRotate(); - public abstract boolean canAttack(); - public abstract boolean canAttack(Pawn other); - public abstract boolean canAssistAttackWithoutLos(); + public abstract boolean canEngage(); + public abstract boolean canEngage(Pawn other); + public abstract boolean canAssistEngagementWithoutLos(); public abstract void move(); - public abstract void attack(); + public abstract void engage(); public abstract void revertLastMove(); @@ -158,17 +158,17 @@ public abstract class Pawn implements Moveable, Disposable public void reset() { - attack.reset(); - move.reset(); + engagement.reset(); + movement.reset(); } public void enterBoard(Tile to, Orientation o) { - move.to = to; - move.from = null; - move.entryMove = true; - move.orientation = o; - move.cost = to.costFrom(this, o); + movement.to = to; + movement.from = null; + movement.entryMove = true; + movement.orientation = o; + movement.cost = to.costFrom(this, o); move(); } @@ -189,7 +189,7 @@ public abstract class Pawn implements Moveable, Disposable public boolean isFlankAttack() { - return (attack.isClear && attack.isFlank); + return (engagement.isClear && engagement.isFlank); } public Tile getTile() diff --git a/core/src/ch/asynk/tankontank/engine/PossiblePaths.java b/core/src/ch/asynk/tankontank/engine/PossiblePaths.java index 318aafc..83ce92e 100644 --- a/core/src/ch/asynk/tankontank/engine/PossiblePaths.java +++ b/core/src/ch/asynk/tankontank/engine/PossiblePaths.java @@ -170,9 +170,9 @@ public class PossiblePaths implements Iterable<Vector3> public void applyToPawn(int i) { - pawn.move.from = from; - pawn.move.to = to; - pawn.move.orientation = orientation; + pawn.movement.from = from; + pawn.movement.to = to; + pawn.movement.orientation = orientation; pathCost(i); } @@ -196,9 +196,9 @@ public class PossiblePaths implements Iterable<Vector3> if (cost < 1) cost = 1; - pawn.move.cost = cost; - pawn.move.roadMarch = roadMarch; - pawn.move.distance = (1 + paths.get(i).size()); + pawn.movement.cost = cost; + pawn.movement.roadMarch = roadMarch; + pawn.movement.distance = (1 + paths.get(i).size()); return cost; } diff --git a/core/src/ch/asynk/tankontank/engine/SearchBoard.java b/core/src/ch/asynk/tankontank/engine/SearchBoard.java index 2c5e326..a93bd67 100644 --- a/core/src/ch/asynk/tankontank/engine/SearchBoard.java +++ b/core/src/ch/asynk/tankontank/engine/SearchBoard.java @@ -265,7 +265,7 @@ public class SearchBoard Node adjacents[] = new Node[6]; - int range = pawn.getAttackRangeFrom(pawn.getTile()); + int range = pawn.getEngagementRangeFrom(pawn.getTile()); int angle = pawn.getAngleOfAttack(); int extendedAngle = pawn.getOrientation().opposite().allBut(); @@ -308,7 +308,7 @@ public class SearchBoard Iterator<Pawn> it = t.iterator(); while (it.hasNext()) { Pawn target = it.next(); - if (pawn.canAttack(target)) + if (pawn.canEngage(target)) targets.add(target); } } @@ -325,11 +325,11 @@ public class SearchBoard Node from = getNode(pawn.getTile()); Node to = getNode(target.getTile()); - pawn.attack.isClear = false; - pawn.attack.target = target; - pawn.attack.distance = distance(from, to); + pawn.engagement.isClear = false; + pawn.engagement.target = target; + pawn.engagement.distance = distance(from, to); - if (pawn.attack.distance > pawn.getAttackRangeFrom(pawn.getTile())) + if (pawn.engagement.distance > pawn.getEngagementRangeFrom(pawn.getTile())) return false; List<Node> los = lineOfSight(from.col, from.row, to.col, to.row, clearVisibility); @@ -340,8 +340,8 @@ public class SearchBoard if (!validatePathAngle(pawn.getAngleOfAttack(), los)) return false; - pawn.attack.isClear = true; - pawn.attack.isFlank = isFlankAttack(target.getFlankSides(), los); + pawn.engagement.isClear = true; + pawn.engagement.isFlank = isFlankAttack(target.getFlankSides(), los); return true; } |