|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgames.strategy.triplea.delegate.BattleCalculator
public class BattleCalculator
| Method Summary | |
|---|---|
static Tuple<java.util.List<Unit>,java.util.List<Unit>> |
categorizeLowLuckAirUnits(java.util.Collection<Unit> units,
Territory location)
http://triplea.sourceforge.net/mywiki/Forum#nabble-td4658925%7Ca4658925 returns two lists, the first list is the air units that can be evenly divided into groups of 3 or 6 (depending on radar) the second list is all the air units that do not fit in the first list |
static java.util.Collection<Unit> |
getAACasualties(java.util.Collection<Unit> planes,
DiceRoll dice,
IDelegateBridge bridge,
PlayerID defender,
PlayerID attacker,
GameData data,
GUID battleID,
Territory terr)
Choose plane casualties according to specified rules |
static int |
getAAHits(java.util.Collection<Unit> units,
IDelegateBridge bridge,
int[] dice)
|
static IntegerMap<UnitType> |
getCosts(PlayerID player,
GameData data)
Return map where keys are unit types and values are PU costs of that unit type |
static java.util.Map<Unit,java.util.Collection<Unit>> |
getDependents(java.util.Collection<Unit> targets,
GameData data)
|
static int |
getRolls(java.util.Collection<Unit> units,
PlayerID id,
boolean defend)
|
static int |
getRolls(java.util.Collection<Unit> units,
PlayerID id,
boolean defend,
int availableSupport)
|
static int |
getRolls(Unit unit,
PlayerID id,
boolean defend)
|
static int |
getRolls(Unit unit,
PlayerID id,
boolean defend,
int artillerySupport)
|
static int |
getTUV(java.util.Collection<Unit> units,
IntegerMap<UnitType> costs)
Return the total unit value |
static int |
getTUV(java.util.Collection<Unit> units,
PlayerID player,
IntegerMap<UnitType> costs,
GameData data)
Return the total unit value for a certain player and his allies |
static java.util.Collection<Unit> |
IndividuallyFiredAACasualties(java.util.Collection<Unit> planes,
DiceRoll dice,
IDelegateBridge bridge,
PlayerID player)
Choose plane casualties based on individual AA shots at each aircraft. |
static java.util.Collection<Unit> |
RandomAACasualties(java.util.Collection<Unit> planes,
DiceRoll dice,
IDelegateBridge bridge)
Choose plane casualties randomly |
static CasualtyDetails |
selectCasualties(PlayerID player,
java.util.Collection<Unit> targets,
IDelegateBridge bridge,
java.lang.String text,
GameData data,
DiceRoll dice,
boolean defending,
GUID battleID)
|
static CasualtyDetails |
selectCasualties(java.lang.String step,
PlayerID player,
java.util.Collection<Unit> targets,
IDelegateBridge bridge,
java.lang.String text,
GameData data,
DiceRoll dice,
boolean defending,
GUID battleID,
boolean headLess,
int extraHits)
|
static void |
sortPreBattle(java.util.List<Unit> units,
GameData data)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void sortPreBattle(java.util.List<Unit> units,
GameData data)
public static int getAAHits(java.util.Collection<Unit> units,
IDelegateBridge bridge,
int[] dice)
public static java.util.Collection<Unit> getAACasualties(java.util.Collection<Unit> planes,
DiceRoll dice,
IDelegateBridge bridge,
PlayerID defender,
PlayerID attacker,
GameData data,
GUID battleID,
Territory terr)
public static Tuple<java.util.List<Unit>,java.util.List<Unit>> categorizeLowLuckAirUnits(java.util.Collection<Unit> units,
Territory location)
public static java.util.Collection<Unit> RandomAACasualties(java.util.Collection<Unit> planes,
DiceRoll dice,
IDelegateBridge bridge)
public static java.util.Collection<Unit> IndividuallyFiredAACasualties(java.util.Collection<Unit> planes,
DiceRoll dice,
IDelegateBridge bridge,
PlayerID player)
public static CasualtyDetails selectCasualties(PlayerID player,
java.util.Collection<Unit> targets,
IDelegateBridge bridge,
java.lang.String text,
GameData data,
DiceRoll dice,
boolean defending,
GUID battleID)
public static CasualtyDetails selectCasualties(java.lang.String step,
PlayerID player,
java.util.Collection<Unit> targets,
IDelegateBridge bridge,
java.lang.String text,
GameData data,
DiceRoll dice,
boolean defending,
GUID battleID,
boolean headLess,
int extraHits)
battleID - may be null if we are not in a battle (eg, if this is an aa fire due to moving
public static java.util.Map<Unit,java.util.Collection<Unit>> getDependents(java.util.Collection<Unit> targets,
GameData data)
public static IntegerMap<UnitType> getCosts(PlayerID player,
GameData data)
player - The player to get costs schedule fordata - The game data.
public static int getTUV(java.util.Collection<Unit> units,
IntegerMap<UnitType> costs)
units - A collection of unitscosts - An integer map of unit types to costs.
public static int getTUV(java.util.Collection<Unit> units,
PlayerID player,
IntegerMap<UnitType> costs,
GameData data)
units - A collection of unitsplayer - The player to calculate the TUV for.costs - An integer map of unit types to costs
public static int getRolls(java.util.Collection<Unit> units,
PlayerID id,
boolean defend)
public static int getRolls(java.util.Collection<Unit> units,
PlayerID id,
boolean defend,
int availableSupport)
public static int getRolls(Unit unit,
PlayerID id,
boolean defend)
public static int getRolls(Unit unit,
PlayerID id,
boolean defend,
int artillerySupport)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||