Enum Class TokenColor

java.lang.Object
java.lang.Enum<TokenColor>
polimi.ingsw.am21.codex.model.Player.TokenColor
All Implemented Interfaces:
Serializable, Comparable<TokenColor>, Constable, GuiElement, Colorable

public enum TokenColor extends Enum<TokenColor> implements Colorable, Serializable, GuiElement
  • Enum Constant Details

  • Method Details

    • values

      public static TokenColor[] 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 TokenColor 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
    • getColor

      public Color getColor()
      Specified by:
      getColor in interface Colorable
    • fromString

      public static TokenColor fromString(String color)
      Gets a TokenColor from a string corresponding to the enum keys
      Parameters:
      color - the string to convert
    • getImagePath

      public String getImagePath()
      Description copied from interface: GuiElement
      Gets the path of the image representing the element, relative to the base path. Does not need a leading slash.
      Specified by:
      getImagePath in interface GuiElement