use of games.strategy.util.IntegerMap in project triplea by triplea-game.
the class PlaceDelegateTest method testCanProduceInSea.
@Test
public void testCanProduceInSea() {
final IntegerMap<UnitType> map = new IntegerMap<>();
map.add(transport, 2);
final PlaceableUnits response = delegate.getPlaceableUnits(GameDataTestUtil.getUnits(map, british), northSea);
assertFalse(response.isError());
}
use of games.strategy.util.IntegerMap in project triplea by triplea-game.
the class VictoryTest method testPuOnlyResourcesToPurchase.
@Test
public void testPuOnlyResourcesToPurchase() {
testBridge.setStepName("italianPurchase");
purchaseDelegate.setDelegateBridgeAndPlayer(testBridge);
purchaseDelegate.start();
final IntegerMap<ProductionRule> purchaseList = new IntegerMap<>();
final ProductionRule buyArmour = gameData.getProductionRuleList().getProductionRule("buyArmour");
assertNotNull(buyArmour);
italianResources.subtract(buyArmour.getCosts());
purchaseList.add(buyArmour, 1);
final String error = purchaseDelegate.purchase(purchaseList);
assertEquals(null, error);
assertEquals(italianResources, italians.getResources().getResourcesCopy());
}
use of games.strategy.util.IntegerMap in project triplea by triplea-game.
the class MoveDelegateTest method testAirCanFlyOverWater.
@Test
public void testAirCanFlyOverWater() {
final IntegerMap<UnitType> map = new IntegerMap<>();
map.put(bomber, 2);
final Route route = new Route();
route.setStart(egypt);
// exast movement to force landing
route.add(redSea);
route.add(syria);
final String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertValid(results);
}
use of games.strategy.util.IntegerMap in project triplea by triplea-game.
the class MoveDelegateTest method testCanReturnToCarrier.
@Test
public void testCanReturnToCarrier() {
final IntegerMap<UnitType> map = new IntegerMap<>();
map.put(fighter, 3);
final Route route = new Route();
route.setStart(congoSeaZone);
route.add(southAtlantic);
route.add(antarticSea);
final String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertValid(results);
}
use of games.strategy.util.IntegerMap in project triplea by triplea-game.
the class MoveDelegateTest method testMoveTransportsTwice.
@Test
public void testMoveTransportsTwice() {
// move transports
Route route = new Route();
route.setStart(congoSeaZone);
route.add(southAtlantic);
final IntegerMap<UnitType> map = new IntegerMap<>();
map.put(infantry, 2);
map.put(transport, 1);
String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertValid(results);
// move again
route = new Route();
route.setStart(southAtlantic);
route.add(angolaSeaZone);
results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
assertValid(results);
}
Aggregations