summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/rustanddust/engine/Pawn.java4
-rw-r--r--core/src/ch/asynk/rustanddust/game/Factory.java34
-rw-r--r--core/src/ch/asynk/rustanddust/game/Order.java6
-rw-r--r--core/src/ch/asynk/rustanddust/game/Unit.java20
-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
-rw-r--r--core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java8
8 files changed, 82 insertions, 82 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/Pawn.java b/core/src/ch/asynk/rustanddust/engine/Pawn.java
index 6cfa6fa..5a40c9f 100644
--- a/core/src/ch/asynk/rustanddust/engine/Pawn.java
+++ b/core/src/ch/asynk/rustanddust/engine/Pawn.java
@@ -25,7 +25,7 @@ public abstract class Pawn implements Moveable, Disposable
{
}
- public interface PawnId
+ public interface PawnCode
{
}
@@ -51,7 +51,7 @@ public abstract class Pawn implements Moveable, Disposable
public abstract boolean preventDefenseOn(Tile tile);
public abstract boolean isUnit();
- public abstract boolean isA(PawnId id);
+ public abstract boolean isA(PawnCode code);
public abstract boolean isA(PawnType type);
public abstract boolean isHq();
public abstract boolean isHqOf(Pawn other);
diff --git a/core/src/ch/asynk/rustanddust/game/Factory.java b/core/src/ch/asynk/rustanddust/game/Factory.java
index 996da3d..398ac70 100644
--- a/core/src/ch/asynk/rustanddust/game/Factory.java
+++ b/core/src/ch/asynk/rustanddust/game/Factory.java
@@ -6,7 +6,7 @@ import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;
import ch.asynk.rustanddust.RustAndDust;
import ch.asynk.rustanddust.engine.Board;
-import ch.asynk.rustanddust.game.Unit.UnitId;
+import ch.asynk.rustanddust.game.Unit.UnitCode;
import ch.asynk.rustanddust.game.Unit.UnitType;
import ch.asynk.rustanddust.game.battles.Map00;
import ch.asynk.rustanddust.game.battles.Battle00;
@@ -113,61 +113,61 @@ public class Factory implements Board.TileBuilder, Disposable
return new Player(id, Army.GE);
}
- public Unit getUnit(UnitId id, boolean hq, boolean ace)
+ public Unit getUnit(UnitCode code, boolean hq, boolean ace)
{
Unit u = null;
UnitType ut = UnitType.HARD_TARGET;
- switch(id) {
+ switch(code) {
case GE_AT_GUN:
ut = UnitType.AT_GUN;
- u = buildUnit(Army.GE, id, ut, hq, ace, 3, 8, 9, 1, "ge-at-gun");
+ u = buildUnit(Army.GE, code, ut, hq, ace, 3, 8, 9, 1, "ge-at-gun");
break;
case GE_INFANTRY:
ut = UnitType.INFANTRY;
- u = buildUnit(Army.GE, id, ut, hq, ace, 1, 7, 10, 1, "ge-infantry");
+ u = buildUnit(Army.GE, code, ut, hq, ace, 1, 7, 10, 1, "ge-infantry");
break;
case GE_KINGTIGER:
- u = buildUnit(Army.GE, id, ut, hq, ace, 3, 12, -1, 1, "ge-kingtiger");
+ u = buildUnit(Army.GE, code, ut, hq, ace, 3, 12, -1, 1, "ge-kingtiger");
break;
case GE_PANZER_IV:
- u = buildUnit(Army.GE, id, ut, hq, ace, 2, 9, -1, 2, "ge-panzer-iv");
+ u = buildUnit(Army.GE, code, ut, hq, ace, 2, 9, -1, 2, "ge-panzer-iv");
break;
case GE_TIGER:
- u = buildUnit(Army.GE, id, ut, hq, ace, 3, 11, -1, 1, "ge-tiger");
+ u = buildUnit(Army.GE, code, ut, hq, ace, 3, 11, -1, 1, "ge-tiger");
break;
case GE_WESPE:
ut = UnitType.ARTILLERY;
- u = buildUnit(Army.GE, id, ut, hq, ace, 5, 8, -1, 1, "ge-wespe");
+ u = buildUnit(Army.GE, code, ut, hq, ace, 5, 8, -1, 1, "ge-wespe");
break;
case US_AT_GUN:
ut = UnitType.AT_GUN;
- u = buildUnit(Army.US, id, ut, hq, ace, 1, 7, 10, 1, "us-at-gun");
+ u = buildUnit(Army.US, code, ut, hq, ace, 1, 7, 10, 1, "us-at-gun");
break;
case US_INFANTRY:
ut = UnitType.INFANTRY;
- u = buildUnit(Army.US, id, ut, hq, ace, 1, 7, 10, 1, "us-infantry");
+ u = buildUnit(Army.US, code, ut, hq, ace, 1, 7, 10, 1, "us-infantry");
break;
case US_PERSHING:
- u = buildUnit(Army.US, id, ut, hq, ace, 3, 10, -1, 3, "us-m26-pershing");
+ u = buildUnit(Army.US, code, ut, hq, ace, 3, 10, -1, 3, "us-m26-pershing");
break;
case US_PRIEST:
ut = UnitType.ARTILLERY;
- u = buildUnit(Army.US, id, ut, hq, ace, 5, 8, -1, 1, "us-m7-priest");
+ u = buildUnit(Army.US, code, ut, hq, ace, 5, 8, -1, 1, "us-m7-priest");
break;
case US_SHERMAN:
- u = buildUnit(Army.US, id, ut, hq, ace, 2, 9, -1, 2, "us-m4-sherman");
+ u = buildUnit(Army.US, code, ut, hq, ace, 2, 9, -1, 2, "us-m4-sherman");
break;
case US_WOLVERINE:
- u = buildUnit(Army.US, id, ut, hq, ace, 3, 8, -1, 3, "us-m10-wolverine");
+ u = buildUnit(Army.US, code, ut, hq, ace, 3, 8, -1, 3, "us-m10-wolverine");
break;
}
return u;
}
- private Unit buildUnit(Army army, UnitId id, UnitType ut, boolean hq, boolean ace, int a, int d, int cd, int m, String chit)
+ private Unit buildUnit(Army army, UnitCode code, UnitType ut, boolean hq, boolean ace, int a, int d, int cd, int m, String chit)
{
- return new Unit(army, id, ut, hq, ace, a, d, cd, m, getUnitRegion(chit), getBody(army, chit), getTurret(army, chit), unitOverlaysAtlas);
+ return new Unit(army, code, ut, hq, ace, a, d, cd, m, getUnitRegion(chit), getBody(army, chit), getTurret(army, chit), unitOverlaysAtlas);
}
private AtlasRegion getBody(Army army, String chit)
diff --git a/core/src/ch/asynk/rustanddust/game/Order.java b/core/src/ch/asynk/rustanddust/game/Order.java
index 09f17a3..9f99906 100644
--- a/core/src/ch/asynk/rustanddust/game/Order.java
+++ b/core/src/ch/asynk/rustanddust/game/Order.java
@@ -39,7 +39,7 @@ public class Order implements Disposable, Pool.Poolable, Comparable<Unit>
public OrderType type;
public Unit unit;
- public Unit.UnitId unitId;
+ public Unit.UnitCode unitCode;
public Unit.UnitType unitType;
public Hex unitHex;
public Move move;
@@ -87,7 +87,7 @@ public class Order implements Disposable, Pool.Poolable, Comparable<Unit>
@Override
public String toString()
{
- return String.format("%s : %s", type, unit.id);
+ return String.format("%s : %s", type, unit.code);
}
public void setMove(Unit unit, Move move)
@@ -113,7 +113,7 @@ public class Order implements Disposable, Pool.Poolable, Comparable<Unit>
private void setUnit(Unit unit)
{
this.unit = unit;
- this.unitId = unit.id;
+ this.unitCode = unit.code;
this.unitType = unit.type;
this.unitHex = unit.getHex();
}
diff --git a/core/src/ch/asynk/rustanddust/game/Unit.java b/core/src/ch/asynk/rustanddust/game/Unit.java
index 7189f17..df824d8 100644
--- a/core/src/ch/asynk/rustanddust/game/Unit.java
+++ b/core/src/ch/asynk/rustanddust/game/Unit.java
@@ -31,7 +31,7 @@ public class Unit extends HeadedPawn
ARTILLERY
}
- public enum UnitId implements Pawn.PawnId
+ public enum UnitCode implements Pawn.PawnCode
{
GE_AT_GUN("German Anti-Tank Gun"),
GE_INFANTRY("German Infantry"),
@@ -48,7 +48,7 @@ public class Unit extends HeadedPawn
US_WOLVERINE("US Wolverine");
private String s;
- UnitId(String s) { this.s = s; }
+ UnitCode(String s) { this.s = s; }
public String toString() { return s; }
}
@@ -57,8 +57,8 @@ public class Unit extends HeadedPawn
public int cdef;
public int mp;
public int mpLeft;
+ public UnitCode code;
public UnitType type;
- public UnitId id;
public boolean hq;
public boolean ace;
public boolean hasMoved;
@@ -85,12 +85,12 @@ public class Unit extends HeadedPawn
private void updateDescr()
{
if (cdef == -1)
- this.descr = id.toString() + (hq ? " HQ " : "") + (ace ? " Ace " : "") + " (" + rng + "-" + def + "-" + mp + ")";
+ this.descr = code.toString() + (hq ? " HQ " : "") + (ace ? " Ace " : "") + " (" + rng + "-" + def + "-" + mp + ")";
else
- this.descr = id.toString() + (hq ? " HQ " : "") + (ace ? " Ace " : "") + " (" + rng + "-" + def + "/" + cdef + "-" + mp + ")";
+ this.descr = code.toString() + (hq ? " HQ " : "") + (ace ? " Ace " : "") + " (" + rng + "-" + def + "/" + cdef + "-" + mp + ")";
}
- public Unit(Army army, UnitId id, UnitType type, boolean hq, boolean ace, int range, int defense, int concealedDefense, int movementPoints,
+ public Unit(Army army, UnitCode code, UnitType type, boolean hq, boolean ace, int range, int defense, int concealedDefense, int movementPoints,
AtlasRegion chit, AtlasRegion body, AtlasRegion turret, TextureAtlas overlays)
{
this(army, chit, body, turret, overlays);
@@ -100,7 +100,7 @@ public class Unit extends HeadedPawn
this.def = defense;
this.cdef = concealedDefense;
this.mp = movementPoints;
- this.id = id;
+ this.code = code;
this.type = type;
commonSetup();
}
@@ -179,9 +179,9 @@ public class Unit extends HeadedPawn
}
@Override
- public boolean isA(PawnId i)
+ public boolean isA(PawnCode c)
{
- return (id == i);
+ return (code == c);
}
@Override
@@ -205,7 +205,7 @@ public class Unit extends HeadedPawn
@Override
public boolean isHqOf(Pawn other)
{
- return (isHq() && other.isA(id));
+ return (isHq() && other.isA(code));
}
public void promote()
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);
}
}
diff --git a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java
index faf6443..fc79203 100644
--- a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java
+++ b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java
@@ -83,7 +83,7 @@ public abstract class Map5Marshal extends Map4Orders
private void unload(Json json, Unit unit, boolean pos)
{
json.writeObjectStart();
- json.writeValue("id", unit.id);
+ json.writeValue("id", unit.code);
json.writeArrayStart("v");
json.writeValue(unit.hq);
json.writeValue(unit.ace);
@@ -131,7 +131,7 @@ public abstract class Map5Marshal extends Map4Orders
unload(json, o.engagement);
break;
case PROMOTE:
- json.writeValue("id", o.unit.id);
+ json.writeValue("id", o.unit.code);
json.writeArrayStart("p");
json.writeValue(o.unitHex.getCol());
json.writeValue(o.unitHex.getRow());
@@ -145,7 +145,7 @@ public abstract class Map5Marshal extends Map4Orders
private void unload(Json json, Move m)
{
json.writeValue("type", m.type);
- json.writeValue("id", ((Unit) m.pawn).id);
+ json.writeValue("id", ((Unit) m.pawn).code);
if (m.from != null) {
json.writeArrayStart("from");
json.writeValue(m.from.getCol());
@@ -196,7 +196,7 @@ public abstract class Map5Marshal extends Map4Orders
{
if (key != null) json.writeObjectStart(key);
else json.writeObjectStart();
- json.writeValue("id", u.id);
+ json.writeValue("id", u.code);
Hex h = u.getHex();
json.writeArrayStart("p");
json.writeValue(h.getCol());