Package net.mtrop.doom.map
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.Reflect, TextObject.Transformer<TO extends TextObject>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLinedef
(UDMFObject linedef) Adds a linedef to this map.void
addSector
(UDMFObject sector) Adds a sector to this map.void
addSidedef
(UDMFObject sidedef) Adds a sidedef to this map.void
addThing
(UDMFObject thing) Adds a thing to this map.void
addVertex
(UDMFObject vertex) Adds a vertex to this map.void
clear()
Clears the contents of this map.getLinedef
(int i) Gets the linedef at a specific index.int
Gets this UDMF namespace.getSector
(int i) Gets the sector at a specific index.int
getSidedef
(int i) Gets the sidedef at a specific index.int
getThing
(int i) Gets the thing at a specific index.int
getVertex
(int i) Gets the vertex at a specific index.int
void
Reads from anReader
and sets this object's fields.void
setLinedefs
(Iterable<UDMFObject> linedefs) Replaces the list of linedefs in the map.void
setNamespace
(String namespace) Sets the UDMF namespace for this map.void
setSectors
(Iterable<UDMFObject> sectors) Replaces the list of sectors in the map.void
setSidedefs
(Iterable<UDMFObject> sidedefs) Replaces the list of sidedefs in the map.void
setThings
(Iterable<UDMFObject> things) Sets the things on this map.void
setVertices
(Iterable<UDMFObject> vertices) Replaces the list of vertices in the map.void
Writes this object to aWriter
.
-
Field Details
-
VERTEX
Type name: Vertex.- See Also:
-
LINEDEF
Type name: Linedef.- See Also:
-
SIDEDEF
Type name: Sidedef.- See Also:
-
SECTOR
Type name: Sector.- See Also:
-
THING
Type name: Thing.- See Also:
-
-
Constructor Details
-
UDMFMap
public UDMFMap()Creates a blank map.
-
-
Method Details
-
clear
public void clear()Clears the contents of this map. -
getNamespace
Gets this UDMF namespace.- Returns:
- the namespace for this UDMF map.
-
setNamespace
Sets the UDMF namespace for this map.- Parameters:
namespace
- the new namespace.
-
readText
Description copied from interface:TextObject
Reads from anReader
and sets this object's fields.- Specified by:
readText
in interfaceTextObject
- Parameters:
reader
- theReader
to read from.- Throws:
IOException
- if a read error occurs.
-
writeText
Description copied from interface:TextObject
Writes this object to aWriter
.- Specified by:
writeText
in interfaceTextObject
- Parameters:
writer
- theWriter
to 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:
getVertexCount
in interfaceMapView<V,
L, S, E, T> - Returns:
- the amount of vertices in this map.
-
getVertex
Description copied from interface:MapView
Gets 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:MapView
Gets the linedef at a specific index.- Specified by:
getLinedef
in 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:
getLinedefCount
in 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:MapView
Gets the sidedef at a specific index.- Specified by:
getSidedef
in 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:
getSidedefCount
in 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:MapView
Gets the sector at a specific index. -
getSectorCount
public int getSectorCount()- Specified by:
getSectorCount
in 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:MapView
Gets the thing at a specific index. -
getThingCount
public int getThingCount()- Specified by:
getThingCount
in interfaceMapView<V,
L, S, E, T> - Returns:
- the amount of things in this map.
-