Enum BattlePhase

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<BattlePhase>

    public enum BattlePhase
    extends java.lang.Enum<BattlePhase>
    • 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.
      • 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
    • Field Detail

      • name

        private final java.lang.String name
      • isMovePhase

        private final boolean isMovePhase
      • isFightPhase

        private final boolean isFightPhase
    • Constructor Detail

      • BattlePhase

        private BattlePhase​(java.lang.String name,
                            boolean isMovePhase,
                            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>