Class DoomMap
java.lang.Object
net.mtrop.doom.map.DoomMap
- All Implemented Interfaces:
MapView<DoomVertex, DoomLinedef, DoomSidedef, DoomSector, DoomThing>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLinedef(DoomLinedef linedef) Adds a linedef to this map.voidaddSector(DoomSector sector) Adds a sector to this map.voidaddSidedef(DoomSidedef sidedef) Adds a sidedef to this map.voidAdds a thing to this map.voidaddVertex(DoomVertex vertex) Adds a vertex to this map.voidclear()Clears the contents of this map.getLinedef(int i) Gets the linedef at a specific index.intgetSector(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.intvoidsetLinedefs(Iterable<DoomLinedef> linedefs) Replaces the list of linedefs in the map.voidsetSectors(Iterable<DoomSector> sectors) Replaces the list of sectors in the map.voidsetSidedefs(Iterable<DoomSidedef> sidedefs) Replaces the list of sidedefs in the map.voidSets the things on this map.voidsetVertices(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:
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
-
setThings
-
addThing
Adds a thing to this map.- Parameters:
thing- the thing to add.
-
getThing
-
getThingCount
public int getThingCount()- Specified by:
getThingCountin interfaceMapView<V,L, S, E, T> - Returns:
- the amount of things in this map.
-