Enum Class TileContents

java.lang.Object
java.lang.Enum<TileContents>
tech.underoaks.coldcase.state.tileContent.TileContents
All Implemented Interfaces:
Serializable, Comparable<TileContents>, Constable

public enum TileContents extends Enum<TileContents>
Enum representing different types of tile contents. Used for mapping indices to tile content classes.
  • Enum Constant Details

  • Method Details

    • values

      public static TileContents[] 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 TileContents 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
    • getIndex

      public int getIndex()
      Gets the unique identifier of this TileContent
      Returns:
      unique identifier of this TileContent
    • getIndexByClass

      public static int getIndexByClass(Class<? extends TileContent> tileClass)
      Gets a TileContent by searching for its identifier
      Parameters:
      tileClass - A Class extending TileContent that will be the search target
      Returns:
      Index of the Class if found; -1 otherwise
    • getNewTileContent

      public TileContent getNewTileContent()
      Creates a new instance of the tile content.
      Returns:
      A new TileContent instance.
    • getNewTileClassByIndex

      public static TileContent getNewTileClassByIndex(int index)
      Retrieves a new TileContent instance based on the given index.
      Parameters:
      index - The index of the TileContent.
      Returns:
      A new TileContent instance.
      Throws:
      IllegalArgumentException - If no TileContent corresponds to the given index.