Class HexenMap

java.lang.Object
net.mtrop.doom.map.HexenMap
All Implemented Interfaces:
MapView<DoomVertex,HexenLinedef,DoomSidedef,DoomSector,HexenThing>

public class HexenMap extends Object
Hexen map in ZDoom/Hexen Format.
Author:
Matthew Tropiano
  • Constructor Details

    • HexenMap

      public HexenMap()
      Creates a blank map.
  • Method Details

    • clear

      public void clear()
      Clears the contents of this map.
    • getVertices

      public List<DoomVertex> getVertices()
      Returns:
      the underlying list of vertices.
    • setVertices

      public void setVertices(Iterable<DoomVertex> vertices)
      Replaces the list of vertices in the map. Input objects are copied to the underlying list.
      Parameters:
      vertices - the new list of vertices.
    • addVertex

      public void addVertex(DoomVertex vertex)
      Adds a vertex to this map.
      Parameters:
      vertex - the vertex to add.
    • getVertexCount

      public int getVertexCount()
      Specified by:
      getVertexCount in interface MapView<V,L,S,E,T>
      Returns:
      the amount of vertices in this map.
    • getVertex

      public DoomVertex getVertex(int i)
      Description copied from interface: MapView
      Gets the vertex at a specific index.
      Specified by:
      getVertex in interface MapView<V,L,S,E,T>
      Parameters:
      i - the desired index.
      Returns:
      the vertex at the index, or null if the index is out of range.
    • getLinedefs

      public List<HexenLinedef> getLinedefs()
      Returns:
      the underlying list of linedefs.
    • setLinedefs

      public void setLinedefs(Iterable<HexenLinedef> linedefs)
      Replaces the list of linedefs in the map. Input objects are copied to the underlying list.
      Parameters:
      linedefs - the new list of linedefs.
    • addLinedef

      public void addLinedef(HexenLinedef linedef)
      Adds a linedef to this map.
      Parameters:
      linedef - the linedef to add.
    • getLinedef

      public HexenLinedef getLinedef(int i)
      Description copied from interface: MapView
      Gets the linedef at a specific index.
      Specified by:
      getLinedef in interface MapView<V,L,S,E,T>
      Parameters:
      i - the desired index.
      Returns:
      the linedef at the index, or null if the index is out of range.
    • getLinedefCount

      public int getLinedefCount()
      Specified by:
      getLinedefCount in interface MapView<V,L,S,E,T>
      Returns:
      the amount of linedefs in this map.
    • getSidedefs

      public List<DoomSidedef> getSidedefs()
      Returns:
      the underlying list of sidedefs.
    • setSidedefs

      public void setSidedefs(Iterable<DoomSidedef> sidedefs)
      Replaces the list of sidedefs in the map. Input objects are copied to the underlying list.
      Parameters:
      sidedefs - the new list of sidedefs.
    • addSidedef

      public void addSidedef(DoomSidedef sidedef)
      Adds a sidedef to this map.
      Parameters:
      sidedef - the sidedef to add.
    • getSidedef

      public DoomSidedef getSidedef(int i)
      Description copied from interface: MapView
      Gets the sidedef at a specific index.
      Specified by:
      getSidedef in interface MapView<V,L,S,E,T>
      Parameters:
      i - the desired index.
      Returns:
      the sidedef at the index, or null if the index is out of range.
    • getSidedefCount

      public int getSidedefCount()
      Specified by:
      getSidedefCount in interface MapView<V,L,S,E,T>
      Returns:
      the amount of sidedefs in this map.
    • getSectors

      public List<DoomSector> getSectors()
      Returns:
      the underlying list of sectors.
    • setSectors

      public void setSectors(Iterable<DoomSector> sectors)
      Replaces the list of sectors in the map. Input objects are copied to the underlying list.
      Parameters:
      sectors - the new list of sectors.
    • addSector

      public void addSector(DoomSector sector)
      Adds a sector to this map.
      Parameters:
      sector - the sector to add.
    • getSector

      public DoomSector getSector(int i)
      Description copied from interface: MapView
      Gets the sector at a specific index.
      Specified by:
      getSector in interface MapView<V,L,S,E,T>
      Parameters:
      i - the desired index.
      Returns:
      the sector at the index, or null if the index is out of range.
    • getSectorCount

      public int getSectorCount()
      Specified by:
      getSectorCount in interface MapView<V,L,S,E,T>
      Returns:
      the amount of sectors in this map.
    • getThings

      public List<HexenThing> getThings()
      Returns:
      the underlying list of things.
    • setThings

      public void setThings(Iterable<HexenThing> things)
      Sets the things on this map. Input objects are copied to the underlying list.
      Parameters:
      things - the new list of things.
    • addThing

      public void addThing(HexenThing thing)
      Adds a thing to this map.
      Parameters:
      thing - the thing to add.
    • getThing

      public HexenThing getThing(int i)
      Description copied from interface: MapView
      Gets the thing at a specific index.
      Specified by:
      getThing in interface MapView<V,L,S,E,T>
      Parameters:
      i - the desired index.
      Returns:
      the thing at the index, or null if the index is out of range.
    • getThingCount

      public int getThingCount()
      Specified by:
      getThingCount in interface MapView<V,L,S,E,T>
      Returns:
      the amount of things in this map.