java.lang.Object
de.gurkenlabs.litiengine.environment.tilemap.xml.CustomPropertyProvider
de.gurkenlabs.litiengine.environment.tilemap.xml.WangSet
All Implemented Interfaces:
ICustomPropertyProvider, ITerrainSet

public class WangSet extends CustomPropertyProvider implements ITerrainSet
  • Constructor Details

    • WangSet

      public WangSet()
  • Method Details

    • getName

      public String getName()
      Description copied from interface: ITerrainSet
      Gets the name of this terrain set.
      Specified by:
      getName in interface ITerrainSet
      Returns:
      THe name of the terrain set.
    • getType

      public TerrainType getType()
      Description copied from interface: ITerrainSet
      Gets the type of terrain represented by this instance.

      This method returns the specific type of terrain as an element of the TerrainType enumeration. The TerrainType enum defines different types of terrain, including "corner," "edge," and "mixed." The return value indicates the classification of the terrain associated with the current instance.

      Specified by:
      getType in interface ITerrainSet
      Returns:
      The TerrainType representing the type of terrain.
      See Also:
    • getTerrains

      public List<ITerrain> getTerrains()
      Description copied from interface: ITerrainSet
      Gets the terrains defined by this terrain set.
      Specified by:
      getTerrains in interface ITerrainSet
      Returns:
      The terrains defined by this instance.
    • getTerrains

      public ITerrain[] getTerrains(int tileId)
      Description copied from interface: ITerrainSet
      Gets the terrains object associated with the specified tile ID.

      This method searches through the collection of Wang tiles to find a match for the specified tile ID. If a match is found, it extracts the Wang IDs associated with the tile and maps them to terrains defined by this ITerrainSet. The resulting array contains references to the corresponding terrain objects based on the Wang IDs. If a Wang ID is 0, the corresponding terrain in the array is set to null.

      Specified by:
      getTerrains in interface ITerrainSet
      Parameters:
      tileId - The tile ID for which terrains are to be retrieved.
      Returns:
      An array of ITerrain objects representing the terrains associated with the given tile ID.