Package net.mtrop.doom.map
Class DoomMap
java.lang.Object
net.mtrop.doom.map.DoomMap
- All Implemented Interfaces:
MapView<DoomVertex,
DoomLinedef, DoomSidedef, DoomSector, DoomThing>
Doom map in Doom Format.
- Author:
- Matthew Tropiano
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLinedef
(DoomLinedef linedef) Adds a linedef to this map.void
addSector
(DoomSector sector) Adds a sector to this map.void
addSidedef
(DoomSidedef sidedef) Adds a sidedef to this map.void
Adds a thing to this map.void
addVertex
(DoomVertex 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
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
setLinedefs
(Iterable<DoomLinedef> linedefs) Replaces the list of linedefs in the map.void
setSectors
(Iterable<DoomSector> sectors) Replaces the list of sectors in the map.void
setSidedefs
(Iterable<DoomSidedef> sidedefs) Replaces the list of sidedefs in the map.void
Sets the things on this map.void
setVertices
(Iterable<DoomVertex> vertices) Replaces the list of vertices in the map.
-
Constructor Details
-
DoomMap
public DoomMap()Creates a blank map.
-
-
Method Details
-
clear
public void clear()Clears the contents of this map. -
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.
-