|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgames.strategy.triplea.baseAI.AIUtils
public class AIUtils
Handy utility methods for the writers of an AI.
| Constructor Summary | |
|---|---|
AIUtils()
|
|
| Method Summary | |
|---|---|
static int |
getCost(UnitType unitType,
PlayerID player,
GameData data)
How many PU's does it cost the given player to produce the given unit type. |
static java.util.Comparator<Unit> |
getCostComparator()
|
static ProductionRule |
getProductionRule(UnitType unitType,
PlayerID player,
GameData data)
Get the production rule for the given player, for the given unit type. |
static float |
strength(java.util.Collection<Unit> units,
boolean attacking,
boolean sea)
Get a quick and dirty estimate of the strength of some units in a battle. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AIUtils()
| Method Detail |
|---|
public static int getCost(UnitType unitType,
PlayerID player,
GameData data)
If the player cannot produce the given unit, return Integer.MAX_VALUE
public static java.util.Comparator<Unit> getCostComparator()
public static ProductionRule getProductionRule(UnitType unitType,
PlayerID player,
GameData data)
If no such rule can be found, then return null.
public static float strength(java.util.Collection<Unit> units,
boolean attacking,
boolean sea)
units - - the units to measureattacking - - are the units on attack or defensesea - - calculate the strength of the units in a sea or land battle?
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||