summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust/game/map
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-24 23:53:27 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-24 23:53:27 +0100
commit5d0f17b24691308cadeacd2d86774c5b3c8cb7c8 (patch)
tree24ccee3fdc3be8acc5342448abff0a6cd3c8cd22 /core/src/ch/asynk/rustanddust/game/map
parenta460eb961b40eab453bd865dda66aaede750b6a3 (diff)
downloadRustAndDust-5d0f17b24691308cadeacd2d86774c5b3c8cb7c8.zip
RustAndDust-5d0f17b24691308cadeacd2d86774c5b3c8cb7c8.tar.gz
engine.Order, engine.OrderList, game.Command -> game.Order, game.OrderList
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game/map')
-rw-r--r--core/src/ch/asynk/rustanddust/game/map/Map4Orders.java (renamed from core/src/ch/asynk/rustanddust/game/map/Map4Commands.java)52
1 files changed, 26 insertions, 26 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/map/Map4Commands.java b/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java
index 2335475..3aa0bbf 100644
--- a/core/src/ch/asynk/rustanddust/game/map/Map4Commands.java
+++ b/core/src/ch/asynk/rustanddust/game/map/Map4Orders.java
@@ -5,42 +5,42 @@ import com.badlogic.gdx.graphics.Texture;
import ch.asynk.rustanddust.RustAndDust;
import ch.asynk.rustanddust.engine.Move;
import ch.asynk.rustanddust.engine.SelectedTile;
-import ch.asynk.rustanddust.engine.OrderList;
import ch.asynk.rustanddust.engine.Orientation;
import ch.asynk.rustanddust.game.Hex;
import ch.asynk.rustanddust.game.Unit;
import ch.asynk.rustanddust.game.Player;
-import ch.asynk.rustanddust.game.Command;
+import ch.asynk.rustanddust.game.Order;
+import ch.asynk.rustanddust.game.OrderList;
import ch.asynk.rustanddust.game.Engagement;
import ch.asynk.rustanddust.game.Battle;
-public abstract class Map4Commands extends Map3Animations
+public abstract class Map4Orders extends Map3Animations
{
private final Battle battle;
- private final OrderList commands;
+ private final OrderList orders;
protected abstract int engagementCost(Engagement e);
protected abstract void resolveEngagement(Engagement e);
- public Map4Commands(final RustAndDust game, Texture map, SelectedTile hex)
+ public Map4Orders(final RustAndDust game, Texture map, SelectedTile hex)
{
super(game, map, hex);
this.battle = game.ctrl.battle;
- this.commands = new OrderList(10);
+ this.orders = new OrderList(10);
}
@Override
public void dispose()
{
super.dispose();
- commands.dispose();
- Command.clearPool();
+ orders.dispose();
+ Order.clearPool();
Engagement.clearPool();
}
- protected int commandsSize() { return commands.size(); }
- protected void commandsClear() { commands.dispose(); }
+ protected int ordersSize() { return orders.size(); }
+ protected void ordersClear() { orders.dispose(); }
// STATES ENTRY ->
@@ -51,8 +51,8 @@ public abstract class Map4Commands extends Map3Animations
public boolean setOnBoard(final Unit unit, Hex to, Orientation entry)
{
- commands.dispose(unit);
- return (process(getMoveCommand(unit, Move.getSet(unit, to, entry))) == 1);
+ orders.dispose(unit);
+ return (process(getMoveOrder(unit, Move.getSet(unit, to, entry))) == 1);
}
public boolean enterBoard(final Unit unit, Hex to, int allowedMoves)
@@ -61,25 +61,25 @@ public abstract class Map4Commands extends Map3Animations
if (entry == Orientation.KEEP)
return false;
- return (process(getMoveCommand(unit, Move.getEnter(unit, to, entry))) == 1);
+ return (process(getMoveOrder(unit, Move.getEnter(unit, to, entry))) == 1);
}
public int exitBoard(final Unit unit)
{
- return process(getMoveCommand(unit, paths.getExitMove()));
+ return process(getMoveOrder(unit, paths.getExitMove()));
}
public int moveUnit(final Unit unit)
{
- return process(getMoveCommand(unit, paths.getMove()));
+ return process(getMoveOrder(unit, paths.getMove()));
}
public void revertMoves()
{
for (Unit unit: activatedUnits) {
RustAndDust.debug(" revertMove() " + unit);
- revertLastPawnMove(unit, ((Command) commands.get(unit, Command.CommandType.MOVE)).move);
- commands.dispose(unit, Command.CommandType.MOVE);
+ revertLastPawnMove(unit, ((Order) orders.get(unit, Order.OrderType.MOVE)).move);
+ orders.dispose(unit, Order.OrderType.MOVE);
}
activatedUnits.clear();
}
@@ -91,7 +91,7 @@ public abstract class Map4Commands extends Map3Animations
revertclaim(unit, unit.getHex());
removePawn(unit);
battle.getPlayer().revertUnitEntry(unit);
- commands.dispose(unit);
+ orders.dispose(unit);
unit.reset();
}
@@ -99,23 +99,23 @@ public abstract class Map4Commands extends Map3Animations
{
attack(unit, target, true);
- Command cmd = Command.get(battle.getPlayer());
+ Order cmd = Order.get(battle.getPlayer());
cmd.setEngage(unit, target);
return (process(cmd) == 1);
}
public void promoteUnit(final Unit unit)
{
- Command cmd = Command.get(battle.getPlayer());
+ Order cmd = Order.get(battle.getPlayer());
cmd.setPromote(unit);
process(cmd);
}
// STATES ENTRY <-
- private Command getMoveCommand(Unit unit, Move move)
+ private Order getMoveOrder(Unit unit, Move move)
{
- Command cmd = Command.get(battle.getPlayer());
+ Order cmd = Order.get(battle.getPlayer());
cmd.setMove(unit, move);
return cmd;
}
@@ -139,9 +139,9 @@ public abstract class Map4Commands extends Map3Animations
return 1;
}
- private int process(Command cmd)
+ private int process(Order cmd)
{
- RustAndDust.debug("Command", cmd.toString());
+ RustAndDust.debug("Order", cmd.toString());
int r = 1;
@@ -156,13 +156,13 @@ public abstract class Map4Commands extends Map3Animations
r = doEngagement(cmd.engagement);
break;
default:
- System.err.println(String.format("process wrong Command type %s", cmd.type));
+ System.err.println(String.format("process wrong Order type %s", cmd.type));
r = -1;
break;
}
if (r != -1)
- commands.add(cmd);
+ orders.add(cmd);
return r;
}