use of games.strategy.engine.data.Route in project triplea by triplea-game.
the class MoveDelegateTest method testAirToWater.
@Test
public void testAirToWater() {
final Route route = new Route();
route.setStart(egypt);
route.add(eastMediteranean);
final IntegerMap<UnitType> map = new IntegerMap<>();
map.put(fighter, 3);
map.put(bomber, 3);
final String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertValid(results);
}
use of games.strategy.engine.data.Route in project triplea by triplea-game.
the class MoveDelegateTest method testNonCombatMoveToConquered.
@Test
public void testNonCombatMoveToConquered() {
// take over libya
Route route = new Route();
route.setStart(equatorialAfrica);
route.add(libya);
IntegerMap<UnitType> map = new IntegerMap<>();
map.put(armour, 1);
String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertValid(results);
// go to non combat
bridge.setStepName("britishNonCombatMove");
delegate.setDelegateBridgeAndPlayer(bridge);
delegate.start();
// move more into libya
route = new Route();
route.setStart(equatorialAfrica);
route.add(libya);
map = new IntegerMap<>();
map.put(armour, 1);
results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertValid(results);
}
use of games.strategy.engine.data.Route in project triplea by triplea-game.
the class MoveDelegateTest method testUnitsStayWithTransports.
@Test
public void testUnitsStayWithTransports() {
IntegerMap<UnitType> map = new IntegerMap<>();
map.put(armour, 2);
Route route = new Route();
route.setStart(egypt);
route.add(redSea);
String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route, route.getEnd().getUnits().getUnits());
assertValid(results);
map = new IntegerMap<>();
map.put(armour, 2);
route = new Route();
route.setStart(redSea);
route.add(indianOcean);
results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertError(results);
}
use of games.strategy.engine.data.Route in project triplea by triplea-game.
the class MoveDelegateTest method testTransportCantLoadUnloadAfterBattle.
@Test
public void testTransportCantLoadUnloadAfterBattle() {
bridge = super.getDelegateBridge(russians);
bridge.setStepName("russianCombatMove");
westEurope.setOwner(russians);
// Attacking force
final List<Unit> attackTrns = transport.create(1, russians);
final List<Unit> attackList = bomber.create(2, russians);
attackList.addAll(attackTrns);
bridge.setRandomSource(new ScriptedRandomSource(new int[] { 1 }));
final DiceRoll roll = DiceRoll.rollDice(attackList, false, russians, bridge, new MockBattle(balticSeaZone), "", TerritoryEffectHelper.getEffects(balticSeaZone), null);
assertEquals(2, roll.getHits());
bridge.setStepName("russianNonCombatMove");
// Test the move
final Collection<Unit> moveInf = infantry.create(2, russians);
final Route route = new Route();
route.setStart(karelia);
route.add(balticSeaZone);
route.add(westEurope);
// Once loaded, shouldnt be able to unload
final String results = delegate.move(moveInf, route);
assertError(results);
}
use of games.strategy.engine.data.Route in project triplea by triplea-game.
the class MoveDelegateTest method testNonCombatAttack.
@Test
public void testNonCombatAttack() {
bridge.setStepName("britishNonCombatMove");
delegate.setDelegateBridgeAndPlayer(bridge);
delegate.start();
final Route route = new Route();
route.setStart(equatorialAfrica);
route.add(algeria);
final IntegerMap<UnitType> map = new IntegerMap<>();
map.put(armour, 2);
final String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertError(results);
}
Aggregations