Class UDMFMap
java.lang.Object
net.mtrop.doom.map.UDMFMap
- All Implemented Interfaces:
MapView<UDMFObject, UDMFObject, UDMFObject, UDMFObject, UDMFObject>,TextObject
A map that contains full UDMF map data.
- Author:
- Matthew Tropiano
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.mtrop.doom.object.TextObject
TextObject.ParseException, TextObject.Reflect, TextObject.Transformer<TO extends TextObject> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLinedef(UDMFObject linedef) Adds a linedef to this map.voidaddSector(UDMFObject sector) Adds a sector to this map.voidaddSidedef(UDMFObject sidedef) Adds a sidedef to this map.voidaddThing(UDMFObject thing) Adds a thing to this map.voidaddVertex(UDMFObject vertex) Adds a vertex to this map.voidclear()Clears the contents of this map.getLinedef(int i) Gets the linedef at a specific index.intGets this UDMF namespace.getSector(int i) Gets the sector at a specific index.intgetSidedef(int i) Gets the sidedef at a specific index.intgetThing(int i) Gets the thing at a specific index.intgetVertex(int i) Gets the vertex at a specific index.intvoidReads from anReaderand sets this object's fields.voidsetLinedefs(Iterable<UDMFObject> linedefs) Replaces the list of linedefs in the map.voidsetNamespace(String namespace) Sets the UDMF namespace for this map.voidsetSectors(Iterable<UDMFObject> sectors) Replaces the list of sectors in the map.voidsetSidedefs(Iterable<UDMFObject> sidedefs) Replaces the list of sidedefs in the map.voidsetThings(Iterable<UDMFObject> things) Sets the things on this map.voidsetVertices(Iterable<UDMFObject> vertices) Replaces the list of vertices in the map.voidWrites this object to aWriter.
-
Field Details
-
VERTEX
-
LINEDEF
-
SIDEDEF
-
SECTOR
-
THING
-
-
Constructor Details
-
UDMFMap
public UDMFMap()Creates a blank map.
-
-
Method Details
-
clear
public void clear()Clears the contents of this map. -
getNamespace
-
setNamespace
Sets the UDMF namespace for this map.- Parameters:
namespace- the new namespace.
-
readText
Description copied from interface:TextObjectReads from anReaderand sets this object's fields.- Specified by:
readTextin interfaceTextObject- Parameters:
reader- theReaderto read from.- Throws:
IOException- if a read error occurs.
-
writeText
Description copied from interface:TextObjectWrites this object to aWriter.- Specified by:
writeTextin interfaceTextObject- Parameters:
writer- theWriterto write to.- Throws:
IOException- if a write error occurs.
-
getVertices
- Returns:
- the underlying list of vertices.
-
setVertices
Replaces the list of vertices in the map. Input objects are copied to the underlying list.- Parameters:
vertices- the new list of vertices.
-
addVertex
Adds a vertex to this map.- Parameters:
vertex- the vertex to add.
-
getVertexCount
public int getVertexCount()- Specified by:
getVertexCountin interfaceMapView<V,L, S, E, T> - Returns:
- the amount of vertices in this map.
-
getVertex
Description copied from interface:MapViewGets the vertex at a specific index. -
getLinedefs
- Returns:
- the underlying list of linedefs.
-
setLinedefs
Replaces the list of linedefs in the map. Input objects are copied to the underlying list.- Parameters:
linedefs- the new list of linedefs.
-
addLinedef
Adds a linedef to this map.- Parameters:
linedef- the linedef to add.
-
getLinedef
Description copied from interface:MapViewGets the linedef at a specific index.- Specified by:
getLinedefin interfaceMapView<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:
getLinedefCountin interfaceMapView<V,L, S, E, T> - Returns:
- the amount of linedefs in this map.
-
getSidedefs
- Returns:
- the underlying list of sidedefs.
-
setSidedefs
Replaces the list of sidedefs in the map. Input objects are copied to the underlying list.- Parameters:
sidedefs- the new list of sidedefs.
-
addSidedef
Adds a sidedef to this map.- Parameters:
sidedef- the sidedef to add.
-
getSidedef
Description copied from interface:MapViewGets the sidedef at a specific index.- Specified by:
getSidedefin interfaceMapView<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:
getSidedefCountin interfaceMapView<V,L, S, E, T> - Returns:
- the amount of sidedefs in this map.
-
getSectors
- Returns:
- the underlying list of sectors.
-
setSectors
Replaces the list of sectors in the map. Input objects are copied to the underlying list.- Parameters:
sectors- the new list of sectors.
-
addSector
Adds a sector to this map.- Parameters:
sector- the sector to add.
-
getSector
Description copied from interface:MapViewGets the sector at a specific index. -
getSectorCount
public int getSectorCount()- Specified by:
getSectorCountin interfaceMapView<V,L, S, E, T> - Returns:
- the amount of sectors in this map.
-
getThings
- Returns:
- the underlying list of things.
-
setThings
Sets the things on this map. Input objects are copied to the underlying list.- Parameters:
things- the new list of things.
-
addThing
Adds a thing to this map.- Parameters:
thing- the thing to add.
-
getThing
Description copied from interface:MapViewGets the thing at a specific index. -
getThingCount
public int getThingCount()- Specified by:
getThingCountin interfaceMapView<V,L, S, E, T> - Returns:
- the amount of things in this map.
-