Search in sources :

Example 41 with UnitType

use of games.strategy.engine.data.UnitType in project triplea by triplea-game.

the class PacificTest method testCanLand1AirfieldStart.

@Test
public void testCanLand1AirfieldStart() {
    bridge.setStepName("americanCombatMove");
    final Route route = new Route();
    route.setStart(unitedStates);
    route.add(sz5);
    route.add(sz7);
    route.add(sz8);
    route.add(sz20);
    route.add(midway);
    final IntegerMap<UnitType> map = new IntegerMap<>();
    map.put(fighter, 1);
    final String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
    assertValid(results);
// assertError( results);
}
Also used : IntegerMap(games.strategy.util.IntegerMap) UnitType(games.strategy.engine.data.UnitType) Route(games.strategy.engine.data.Route) Test(org.junit.jupiter.api.Test)

Example 42 with UnitType

use of games.strategy.engine.data.UnitType in project triplea by triplea-game.

the class PacificTest method testCanLand1AirfieldEnd.

@Test
public void testCanLand1AirfieldEnd() {
    bridge.setStepName("americanCombatMove");
    final Route route = new Route();
    route.setStart(unitedStates);
    route.add(sz5);
    route.add(sz7);
    route.add(sz8);
    route.add(sz20);
    route.add(midway);
    final IntegerMap<UnitType> map = new IntegerMap<>();
    map.put(fighter, 1);
    final String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
    assertValid(results);
}
Also used : IntegerMap(games.strategy.util.IntegerMap) UnitType(games.strategy.engine.data.UnitType) Route(games.strategy.engine.data.Route) Test(org.junit.jupiter.api.Test)

Example 43 with UnitType

use of games.strategy.engine.data.UnitType in project triplea by triplea-game.

the class PacificTest method testCanLand2Airfields.

@Test
public void testCanLand2Airfields() {
    bridge.setStepName("americanCombatMove");
    final Route route = new Route();
    route.setStart(unitedStates);
    route.add(sz5);
    route.add(sz4);
    route.add(sz10);
    route.add(sz16);
    route.add(sz27);
    route.add(newBritain);
    final IntegerMap<UnitType> map = new IntegerMap<>();
    map.put(fighter, 1);
    final String results = delegate.move(GameDataTestUtil.getUnits(map, route.getStart()), route);
    assertValid(results);
}
Also used : IntegerMap(games.strategy.util.IntegerMap) UnitType(games.strategy.engine.data.UnitType) Route(games.strategy.engine.data.Route) Test(org.junit.jupiter.api.Test)

Example 44 with UnitType

use of games.strategy.engine.data.UnitType in project triplea by triplea-game.

the class PlaceDelegateTest method testCanNotProduceThatManyUnits.

@Test
public void testCanNotProduceThatManyUnits() {
    final IntegerMap<UnitType> map = new IntegerMap<>();
    map.add(infantry, 3);
    final PlaceableUnits response = delegate.getPlaceableUnits(GameDataTestUtil.getUnits(map, british), westCanada);
    assertTrue(response.getMaxUnits() == 2);
}
Also used : IntegerMap(games.strategy.util.IntegerMap) PlaceableUnits(games.strategy.triplea.delegate.dataObjects.PlaceableUnits) UnitType(games.strategy.engine.data.UnitType) Test(org.junit.jupiter.api.Test)

Example 45 with UnitType

use of games.strategy.engine.data.UnitType 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());
}
Also used : IntegerMap(games.strategy.util.IntegerMap) PlaceableUnits(games.strategy.triplea.delegate.dataObjects.PlaceableUnits) UnitType(games.strategy.engine.data.UnitType) Test(org.junit.jupiter.api.Test)

Aggregations

UnitType (games.strategy.engine.data.UnitType)211 Test (org.junit.jupiter.api.Test)108 IntegerMap (games.strategy.util.IntegerMap)86 Route (games.strategy.engine.data.Route)76 Unit (games.strategy.engine.data.Unit)76 PlayerID (games.strategy.engine.data.PlayerID)64 Territory (games.strategy.engine.data.Territory)58 TripleAUnit (games.strategy.triplea.TripleAUnit)49 ArrayList (java.util.ArrayList)44 ITestDelegateBridge (games.strategy.engine.data.ITestDelegateBridge)36 GameParseException (games.strategy.engine.data.GameParseException)29 ScriptedRandomSource (games.strategy.engine.random.ScriptedRandomSource)23 UnitAttachment (games.strategy.triplea.attachments.UnitAttachment)21 HashSet (java.util.HashSet)17 GameData (games.strategy.engine.data.GameData)15 Change (games.strategy.engine.data.Change)14 CompositeChange (games.strategy.engine.data.CompositeChange)14 Resource (games.strategy.engine.data.Resource)13 NamedAttachable (games.strategy.engine.data.NamedAttachable)11 ProductionRule (games.strategy.engine.data.ProductionRule)11