Package net.sf.colossus.game
Enum Class BattlePhase
- All Implemented Interfaces:
Serializable
,Comparable<BattlePhase>
,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private final boolean
private final String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
BattlePhase
(String name, boolean isMovePhase, boolean isFightPhase) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determine if the phase is part of the fighting.boolean
Determine if the phase is part of the fighting.toString()
Returns a non-localized UI string for the phase.static BattlePhase
Returns the enum constant of this class with the specified name.static BattlePhase[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SUMMON
-
RECRUIT
-
MOVE
-
FIGHT
-
STRIKEBACK
-
-
Field Details
-
name
-
isMovePhase
private final boolean isMovePhase -
isFightPhase
private final boolean isFightPhase
-
-
Constructor Details
-
BattlePhase
-
-
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
-
isFightPhase
public boolean isFightPhase()Determine if the phase is part of the fighting.- Returns:
- true iff the phase is either FIGHT or STRIKEBACK.
-
isMovePhase
public boolean isMovePhase()Determine if the phase is part of the fighting. Right now we consider also SUMMON or RECRUT as move phase (currently they are own phases; I would like those actions to happen as part of the move phase instead, then this here can be changed).- Returns:
- true iff the phase is a move phase;
-
toString
Returns a non-localized UI string for the phase.- Overrides:
toString
in classEnum<BattlePhase>
-