Class UDMFMap

java.lang.Object
net.mtrop.doom.map.UDMFMap
All Implemented Interfaces:
MapView<UDMFObject,UDMFObject,UDMFObject,UDMFObject,UDMFObject>, TextObject

public class UDMFMap extends Object implements TextObject
A map that contains full UDMF map data.
Author:
Matthew Tropiano
  • Field Details

  • Constructor Details

    • UDMFMap

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

    • clear

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

      public String getNamespace()
      Gets this UDMF namespace.
      Returns:
      the namespace for this UDMF map.
    • setNamespace

      public void setNamespace(String namespace)
      Sets the UDMF namespace for this map.
      Parameters:
      namespace - the new namespace.
    • readText

      public void readText(Reader reader) throws IOException
      Description copied from interface: TextObject
      Reads from an Reader and sets this object's fields.
      Specified by:
      readText in interface TextObject
      Parameters:
      reader - the Reader to read from.
      Throws:
      IOException - if a read error occurs.
    • writeText

      public void writeText(Writer writer) throws IOException
      Description copied from interface: TextObject
      Writes this object to a Writer.
      Specified by:
      writeText in interface TextObject
      Parameters:
      writer - the Writer to write to.
      Throws:
      IOException - if a write error occurs.
    • getVertices

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

      public void setVertices(Iterable<UDMFObject> 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(UDMFObject 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 UDMFObject 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<UDMFObject> getLinedefs()
      Returns:
      the underlying list of linedefs.
    • setLinedefs

      public void setLinedefs(Iterable<UDMFObject> 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(UDMFObject linedef)
      Adds a linedef to this map.
      Parameters:
      linedef - the linedef to add.
    • getLinedef

      public UDMFObject 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<UDMFObject> getSidedefs()
      Returns:
      the underlying list of sidedefs.
    • setSidedefs

      public void setSidedefs(Iterable<UDMFObject> 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(UDMFObject sidedef)
      Adds a sidedef to this map.
      Parameters:
      sidedef - the sidedef to add.
    • getSidedef

      public UDMFObject 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<UDMFObject> getSectors()
      Returns:
      the underlying list of sectors.
    • setSectors

      public void setSectors(Iterable<UDMFObject> 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(UDMFObject sector)
      Adds a sector to this map.
      Parameters:
      sector - the sector to add.
    • getSector

      public UDMFObject 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<UDMFObject> getThings()
      Returns:
      the underlying list of things.
    • setThings

      public void setThings(Iterable<UDMFObject> 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(UDMFObject thing)
      Adds a thing to this map.
      Parameters:
      thing - the thing to add.
    • getThing

      public UDMFObject 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.