Enum Tile.TileType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Tile.TileType>
    Enclosing class:
    Tile

    public static enum Tile.TileType
    extends java.lang.Enum<Tile.TileType>
    Encodes all Tile variants. New tiles need to be registered here.
    • Method Detail

      • values

        public static Tile.TileType[] 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 (Tile.TileType c : Tile.TileType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Tile.TileType 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
      • getName

        public java.lang.String getName()
        Get API name of tile.
        Returns:
        name of the tile.
      • newInstance

        public Tile newInstance​(CubeCoordinate coord,
                                org.json.JSONObject data)
        Create a new instance of a tile with coordinates and raw jason data.
        Parameters:
        coord - coordinate of the tile.
        data - extra json data.
        Returns:
        created tile class
      • newInstanceBare

        public Tile newInstanceBare()
        Creates a new instance of a tile without any data.
        Returns:
        created new bare tile instance
      • fromName

        public static Tile.TileType fromName​(java.lang.String name)
        Parse TileType name to enum instance.
        Parameters:
        name - API name of the tile.
        Returns:
        type of the tile name.
      • fromTile

        public static Tile.TileType fromTile​(Tile tile)
        Gets TileType from tile class.
        Parameters:
        tile - tile instance.
        Returns:
        type of the tile.