Enum Class BattlePhase

java.lang.Object
java.lang.Enum<BattlePhase>
net.sf.colossus.game.BattlePhase
All Implemented Interfaces:
Serializable, Comparable<BattlePhase>, Constable

public enum BattlePhase extends Enum<BattlePhase>
  • Enum Constant Details

  • Field Details

    • name

      private final String name
    • isMovePhase

      private final boolean isMovePhase
    • isFightPhase

      private final boolean isFightPhase
  • Constructor Details

    • BattlePhase

      private BattlePhase(String name, boolean isMovePhase, boolean isFightPhase)
  • Method Details

    • values

      public static BattlePhase[] 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

      public static BattlePhase valueOf(String name)
      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 name
      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 String toString()
      Returns a non-localized UI string for the phase.
      Overrides:
      toString in class Enum<BattlePhase>