Enum Class CombatPosture
- All Implemented Interfaces:
Serializable,Comparable<CombatPosture>,Constable
Terrain obstacles - deep water above all - mean opposite things to the two postures, and no single cost tuning produces both behaviors. An attacker treats a river as a cost on the way to the objective: it picks a crossing, pays the risk, and seizes the far bank. A defender treats the same river as its best weapon: it never crosses, holds positions covering the crossing points, and takes the fight to the enemy while the enemy is slowed, split up, and half-disarmed in the water. A bot that prices water one way plays one of those roles well and the other one badly.
AUTO leaves the call to the bot, which reads it from what it already knows each round - whether
it has somewhere to go, and whether the enemy is coming to it. See PostureResolver.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic CombatPostureParses a posture from text, for XML round-trips and behavior scripts.toString()static CombatPostureReturns the enum constant of this class with the specified name.static CombatPosture[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ATTACK
Take ground: obstacles are a cost to pay on the way to the enemy. -
DEFEND
Hold ground: obstacles are a weapon, and the enemy should be the one paying to cross them. -
AUTO
Let the bot decide each round from its mission and the enemy's movement.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
toString
- Overrides:
toStringin classEnum<CombatPosture>
-
parse
Parses a posture from text, for XML round-trips and behavior scripts.- Parameters:
text- the posture name, case-insensitive- Returns:
- the matching posture, or
AUTOwhen the text matches nothing
-