use of games.strategy.engine.data.UnitType in project triplea by triplea-game.
the class MoveDelegateTest method testOverrunNeutralMustStop.
@Test
public void testOverrunNeutralMustStop() {
IntegerMap<UnitType> map = new IntegerMap<>();
map.put(armour, 2);
Route route = new Route();
route.setStart(equatorialAfrica);
route.add(westAfrica);
String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertValid(results);
map = new IntegerMap<>();
map.put(armour, 2);
route = new Route();
route.setStart(westAfrica);
route.add(equatorialAfrica);
results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertError(results);
}
use of games.strategy.engine.data.UnitType in project triplea by triplea-game.
the class MoveDelegateTest method testAirCanLandOnLand.
@Test
public void testAirCanLandOnLand() {
final Route route = new Route();
route.setStart(egypt);
route.add(eastMediteranean);
route.add(blackSea);
final IntegerMap<UnitType> map = new IntegerMap<>();
map.put(fighter, 1);
final String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertValid(results);
}
use of games.strategy.engine.data.UnitType in project triplea by triplea-game.
the class MoveDelegateTest method testLandMoveToWaterWithTransportsFull.
@Test
public void testLandMoveToWaterWithTransportsFull() {
final IntegerMap<UnitType> map = new IntegerMap<>();
map.put(armour, 1);
map.put(infantry, 2);
final Route route = new Route();
route.setStart(equatorialAfrica);
// exast movement to force landing
route.add(congoSeaZone);
assertEquals(4, equatorialAfrica.getUnits().size());
assertEquals(11, congoSeaZone.getUnits().size());
final String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertError(results);
assertEquals(4, equatorialAfrica.getUnits().size());
assertEquals(11, congoSeaZone.getUnits().size());
}
use of games.strategy.engine.data.UnitType in project triplea by triplea-game.
the class MoveDelegateTest method testUnload.
@Test
public void testUnload() {
final IntegerMap<UnitType> map = new IntegerMap<>();
map.put(infantry, 2);
final Route route = new Route();
route.setStart(congoSeaZone);
route.add(equatorialAfrica);
final String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertValid(results);
}
use of games.strategy.engine.data.UnitType in project triplea by triplea-game.
the class MoveDelegateTest method testTakeOverAfterOverFlight.
@Test
public void testTakeOverAfterOverFlight() {
// this was causing an exception
Route route = new Route();
route.setStart(egypt);
route.add(libya);
IntegerMap<UnitType> map = new IntegerMap<>();
map.put(bomber, 1);
String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertValid(results);
route = new Route();
route.setStart(libya);
route.add(algeria);
// planes cannot leave a battle zone, but the territory was empty so no battle occurred
map = new IntegerMap<>();
map.put(bomber, 1);
results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertValid(results);
}
Aggregations