summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust/game/battles
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-02-03 11:57:03 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-02-03 11:57:03 +0100
commit94d279a514326f747ccac8c803b4500955c7a368 (patch)
tree448c3d46dd5257b8e7021cd4a5ebd0d911ccc018 /core/src/ch/asynk/rustanddust/game/battles
parentcbcfb75fbd51915b68c51d15d85fe102a85b50de (diff)
downloadRustAndDust-94d279a514326f747ccac8c803b4500955c7a368.zip
RustAndDust-94d279a514326f747ccac8c803b4500955c7a368.tar.gz
PawnId/UnitID -> PawnCode/UnitCode
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game/battles')
-rw-r--r--core/src/ch/asynk/rustanddust/game/battles/Battle00.java34
-rw-r--r--core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java26
-rw-r--r--core/src/ch/asynk/rustanddust/game/battles/BattleTest.java32
3 files changed, 46 insertions, 46 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/battles/Battle00.java b/core/src/ch/asynk/rustanddust/game/battles/Battle00.java
index 4dcf702..1ede61e 100644
--- a/core/src/ch/asynk/rustanddust/game/battles/Battle00.java
+++ b/core/src/ch/asynk/rustanddust/game/battles/Battle00.java
@@ -3,7 +3,7 @@ package ch.asynk.rustanddust.game.battles;
import ch.asynk.rustanddust.game.Army;
import ch.asynk.rustanddust.game.Player;
import ch.asynk.rustanddust.game.Zone;
-import ch.asynk.rustanddust.game.Unit.UnitId;
+import ch.asynk.rustanddust.game.Unit.UnitCode;
import ch.asynk.rustanddust.game.Factory;
import ch.asynk.rustanddust.ui.Position;
import ch.asynk.rustanddust.engine.Orientation;
@@ -67,7 +67,7 @@ public class Battle00 extends BattleCommon
private void setupUS(final Player p)
{
- setUnit(map, p, UnitId.US_AT_GUN, 11, 7, Orientation.SOUTH, null);
+ setUnit(map, p, UnitCode.US_AT_GUN, 11, 7, Orientation.SOUTH, null);
Zone usEntry = new Zone(map, 10);
usEntry.orientation = Orientation.SOUTH;
@@ -82,14 +82,14 @@ public class Battle00 extends BattleCommon
usEntry.add(10, 4);
usEntry.add(11, 4);
addEntryZone(usEntry);
- addReinforcement(p, usEntry, UnitId.US_SHERMAN, true, false);
- addReinforcement(p, usEntry, UnitId.US_SHERMAN);
- addReinforcement(p, usEntry, UnitId.US_SHERMAN);
- addReinforcement(p, usEntry, UnitId.US_SHERMAN);
- addReinforcement(p, usEntry, UnitId.US_WOLVERINE, true, false);
- addReinforcement(p, usEntry, UnitId.US_WOLVERINE);
- addReinforcement(p, usEntry, UnitId.US_PERSHING);
- addReinforcement(p, usEntry, UnitId.US_PRIEST);
+ addReinforcement(p, usEntry, UnitCode.US_SHERMAN, true, false);
+ addReinforcement(p, usEntry, UnitCode.US_SHERMAN);
+ addReinforcement(p, usEntry, UnitCode.US_SHERMAN);
+ addReinforcement(p, usEntry, UnitCode.US_SHERMAN);
+ addReinforcement(p, usEntry, UnitCode.US_WOLVERINE, true, false);
+ addReinforcement(p, usEntry, UnitCode.US_WOLVERINE);
+ addReinforcement(p, usEntry, UnitCode.US_PERSHING);
+ addReinforcement(p, usEntry, UnitCode.US_PRIEST);
}
private void setupGE(final Player p)
@@ -105,12 +105,12 @@ public class Battle00 extends BattleCommon
geEntry.add(3, 5);
geEntry.add(4, 5);
addEntryZone(geEntry);
- addReinforcement(p, geEntry, UnitId.GE_PANZER_IV, true, false);
- addReinforcement(p, geEntry, UnitId.GE_PANZER_IV);
- addReinforcement(p, geEntry, UnitId.GE_PANZER_IV);
- addReinforcement(p, geEntry, UnitId.GE_PANZER_IV, true, false);
- addReinforcement(p, geEntry, UnitId.GE_TIGER);
- addReinforcement(p, geEntry, UnitId.GE_TIGER);
- addReinforcement(p, geEntry, UnitId.GE_WESPE);
+ addReinforcement(p, geEntry, UnitCode.GE_PANZER_IV, true, false);
+ addReinforcement(p, geEntry, UnitCode.GE_PANZER_IV);
+ addReinforcement(p, geEntry, UnitCode.GE_PANZER_IV);
+ addReinforcement(p, geEntry, UnitCode.GE_PANZER_IV, true, false);
+ addReinforcement(p, geEntry, UnitCode.GE_TIGER);
+ addReinforcement(p, geEntry, UnitCode.GE_TIGER);
+ addReinforcement(p, geEntry, UnitCode.GE_WESPE);
}
}
diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
index 4551d78..354ba29 100644
--- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
+++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
@@ -11,7 +11,7 @@ import ch.asynk.rustanddust.game.Map;
import ch.asynk.rustanddust.game.Zone;
import ch.asynk.rustanddust.game.Hex;
import ch.asynk.rustanddust.game.Unit;
-import ch.asynk.rustanddust.game.Unit.UnitId;
+import ch.asynk.rustanddust.game.Unit.UnitCode;
import ch.asynk.rustanddust.game.Factory;
import ch.asynk.rustanddust.game.State.StateType;
import ch.asynk.rustanddust.engine.Orientation;
@@ -240,38 +240,38 @@ public abstract class BattleCommon implements Battle
exit.enable(Hex.EXIT, true);
}
- protected void addReinforcement(Player player, Zone entryZone, UnitId unitId)
+ protected void addReinforcement(Player player, Zone entryZone, UnitCode unitCode)
{
- addReinforcement(player, entryZone, unitId, false, false);
+ addReinforcement(player, entryZone, unitCode, false, false);
}
- protected void addReinforcement(Player player, Zone entryZone, Zone exitZone, UnitId unitId)
+ protected void addReinforcement(Player player, Zone entryZone, Zone exitZone, UnitCode unitCode)
{
- addReinforcement(player, entryZone, exitZone, unitId, false, false);
+ addReinforcement(player, entryZone, exitZone, unitCode, false, false);
}
- protected void addReinforcement(Player player, Zone entryZone, UnitId unitId, boolean hq, boolean ace)
+ protected void addReinforcement(Player player, Zone entryZone, UnitCode unitCode, boolean hq, boolean ace)
{
- addReinforcement(player, entryZone, null, unitId, hq, ace);
+ addReinforcement(player, entryZone, null, unitCode, hq, ace);
}
- protected void addReinforcement(Player player, Zone entryZone, Zone exitZone, UnitId unitId, boolean hq, boolean ace)
+ protected void addReinforcement(Player player, Zone entryZone, Zone exitZone, UnitCode unitCode, boolean hq, boolean ace)
{
- Unit unit = factory.getUnit(unitId, hq, ace);
+ Unit unit = factory.getUnit(unitCode, hq, ace);
player.addReinforcement(unit);
unitEntry.put(unit, entryZone);
if (exitZone != null)
unitExit.put(unit, exitZone);
}
- protected Unit setUnit(Map map, Player player, UnitId unitId, int col, int row, Orientation orientation, Zone exitZone)
+ protected Unit setUnit(Map map, Player player, UnitCode unitCode, int col, int row, Orientation orientation, Zone exitZone)
{
- return setUnit(map, player, unitId, col, row, orientation, false, false, exitZone);
+ return setUnit(map, player, unitCode, col, row, orientation, false, false, exitZone);
}
- protected Unit setUnit(Map map, Player player, UnitId unitId, int col, int row, Orientation orientation, boolean hq, boolean ace, Zone exitZone)
+ protected Unit setUnit(Map map, Player player, UnitCode unitCode, int col, int row, Orientation orientation, boolean hq, boolean ace, Zone exitZone)
{
- Unit u = factory.getUnit(unitId, hq, ace);
+ Unit u = factory.getUnit(unitCode, hq, ace);
if (exitZone != null)
unitExit.put(u, exitZone);
map.setOnBoard(u, map.getHex(col, row), orientation);
diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java b/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java
index 8466841..d2279cb 100644
--- a/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java
+++ b/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java
@@ -3,7 +3,7 @@ package ch.asynk.rustanddust.game.battles;
import ch.asynk.rustanddust.game.Army;
import ch.asynk.rustanddust.game.Player;
import ch.asynk.rustanddust.game.Zone;
-import ch.asynk.rustanddust.game.Unit.UnitId;
+import ch.asynk.rustanddust.game.Unit.UnitCode;
import ch.asynk.rustanddust.game.Factory;
import ch.asynk.rustanddust.ui.Position;
import ch.asynk.rustanddust.engine.Orientation;
@@ -52,7 +52,7 @@ public class BattleTest extends BattleCommon
usEntry.allowedMoves = (Orientation.SOUTH.s | Orientation.SOUTH_EAST.s | Orientation.SOUTH_WEST.s);
usEntry.add(map.getHex(12, 6));
addEntryZone(usEntry);
- addReinforcement(currentPlayer, usEntry, usExit, UnitId.US_WOLVERINE);
+ addReinforcement(currentPlayer, usEntry, usExit, UnitCode.US_WOLVERINE);
return true;
}
@@ -77,11 +77,11 @@ public class BattleTest extends BattleCommon
private void setupGE(final Player p)
{
- setUnit(map, p, UnitId.GE_WESPE, 6, 8, Orientation.NORTH, null);
- setUnit(map, p, UnitId.GE_TIGER, 5, 2, Orientation.NORTH, null);
- setUnit(map, p, UnitId.GE_PANZER_IV, 4, 5, Orientation.NORTH_WEST, null);
- setUnit(map, p, UnitId.GE_INFANTRY, 1, 2, Orientation.NORTH_WEST, null);
- setUnit(map, p, UnitId.GE_KINGTIGER, 1, 1, Orientation.NORTH_WEST, null);
+ setUnit(map, p, UnitCode.GE_WESPE, 6, 8, Orientation.NORTH, null);
+ setUnit(map, p, UnitCode.GE_TIGER, 5, 2, Orientation.NORTH, null);
+ setUnit(map, p, UnitCode.GE_PANZER_IV, 4, 5, Orientation.NORTH_WEST, null);
+ setUnit(map, p, UnitCode.GE_INFANTRY, 1, 2, Orientation.NORTH_WEST, null);
+ setUnit(map, p, UnitCode.GE_KINGTIGER, 1, 1, Orientation.NORTH_WEST, null);
Zone geEntry = new Zone(map, 6);
geEntry.orientation = Orientation.NORTH;
@@ -90,7 +90,7 @@ public class BattleTest extends BattleCommon
geEntry.add(3, 3);
geEntry.add(3, 4);
addEntryZone(geEntry);
- addReinforcement(p, geEntry, UnitId.GE_AT_GUN);
+ addReinforcement(p, geEntry, UnitCode.GE_AT_GUN);
}
private void setupUS(final Player p)
@@ -102,13 +102,13 @@ public class BattleTest extends BattleCommon
usExit.add(12, 6);
addExitZone(usExit);
- p.casualty(factory.getUnit(UnitId.US_SHERMAN, true, false));
- setUnit(map, p, UnitId.US_PRIEST, 7, 6, Orientation.SOUTH_EAST, usExit);
- setUnit(map, p, UnitId.US_SHERMAN, 8, 4, Orientation.SOUTH, false, true, usExit);
- setUnit(map, p, UnitId.US_SHERMAN, 7, 3, Orientation.SOUTH, true, false, usExit);
- setUnit(map, p, UnitId.US_WOLVERINE, 11, 7, Orientation.SOUTH_EAST, usExit);
- setUnit(map, p, UnitId.US_PERSHING, 6, 5, Orientation.SOUTH, usExit);
- setUnit(map, p, UnitId.US_INFANTRY, 5, 3, Orientation.NORTH_EAST, usExit);
- setUnit(map, p, UnitId.US_AT_GUN, 6, 1, Orientation.SOUTH, usExit);
+ p.casualty(factory.getUnit(UnitCode.US_SHERMAN, true, false));
+ setUnit(map, p, UnitCode.US_PRIEST, 7, 6, Orientation.SOUTH_EAST, usExit);
+ setUnit(map, p, UnitCode.US_SHERMAN, 8, 4, Orientation.SOUTH, false, true, usExit);
+ setUnit(map, p, UnitCode.US_SHERMAN, 7, 3, Orientation.SOUTH, true, false, usExit);
+ setUnit(map, p, UnitCode.US_WOLVERINE, 11, 7, Orientation.SOUTH_EAST, usExit);
+ setUnit(map, p, UnitCode.US_PERSHING, 6, 5, Orientation.SOUTH, usExit);
+ setUnit(map, p, UnitCode.US_INFANTRY, 5, 3, Orientation.NORTH_EAST, usExit);
+ setUnit(map, p, UnitCode.US_AT_GUN, 6, 1, Orientation.SOUTH, usExit);
}
}