net.sf.colossus.game
Enum BattlePhase

java.lang.Object
  extended by java.lang.Enum<BattlePhase>
      extended by 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
FIGHT
           
MOVE
           
RECRUIT
           
STRIKEBACK
           
SUMMON
           
 
Field Summary
private  boolean isFightPhase
           
private  boolean isMovePhase
           
private  java.lang.String name
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

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
Field Detail

name

private final java.lang.String name

isMovePhase

private final boolean isMovePhase

isFightPhase

private final boolean isFightPhase
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 name
java.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 class java.lang.Enum<BattlePhase>