Package net.sf.colossus.game
Enum BattlePhase
- java.lang.Object
-
- java.lang.Enum<BattlePhase>
-
- net.sf.colossus.game.BattlePhase
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<BattlePhase>
public enum BattlePhase extends java.lang.Enum<BattlePhase>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description FIGHT
MOVE
RECRUIT
STRIKEBACK
SUMMON
-
Field Summary
Fields Modifier and Type Field Description private boolean
isFightPhase
private boolean
isMovePhase
private java.lang.String
name
-
Constructor Summary
Constructors Modifier Constructor Description private
BattlePhase(java.lang.String name, boolean isMovePhase, boolean isFightPhase)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isFightPhase()
Determine if the phase is part of the fighting.boolean
isMovePhase()
Determine if the phase is part of the fighting.java.lang.String
toString()
Returns a non-localized UI string for the phase.static BattlePhase
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static BattlePhase[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SUMMON
public static final BattlePhase SUMMON
-
RECRUIT
public static final BattlePhase RECRUIT
-
MOVE
public static final BattlePhase MOVE
-
FIGHT
public static final BattlePhase FIGHT
-
STRIKEBACK
public static final BattlePhase STRIKEBACK
-
-
Method Detail
-
values
public static BattlePhase[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BattlePhase c : BattlePhase.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BattlePhase valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- 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
public java.lang.String toString()
Returns a non-localized UI string for the phase.- Overrides:
toString
in classjava.lang.Enum<BattlePhase>
-
-