Class ZDoomMapInfo
java.lang.Object
net.mtrop.doom.text.ZDoomMapInfo
- All Implemented Interfaces:
Iterable<MapInfoData>,TextObject
An abstraction of the ZDoom Map Info entry (ZMAPINFO/MAPINFO).
All of the data sets in this info are stored in order, as the ordering matters when read.
"Include" directives are not followed - they are instead stored as objects.
- Since:
- 2.19.0
- 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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddChild(String type, MapInfoData.Value... typeValues) Creates a new, empty child set at the end of the list of sets.addChildAt(int index, String type, MapInfoData.Value... typeValues) Creates a new, empty child set to add to at a specific index in the list of sets.getChildAt(int index) Gets a specific typed child set from this MapInfo by its index.intiterator()voidReads from anReaderand sets this object's fields.removeChildAt(int index) Removes a child set at a specific index.voidWrites this object to aWriter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
SETTYPE_INCLUDE
- See Also:
-
SETTYPE_CLEAREPISODES
- See Also:
-
SETTYPE_EPISODE
- See Also:
-
SETTYPE_MAP
- See Also:
-
SETTYPE_DEFAULTMAP
- See Also:
-
SETTYPE_ADDDEFAULTMAP
- See Also:
-
SETTYPE_GAMEDEFAULTS
- See Also:
-
SETTYPE_CLUSTERDEF
- See Also:
-
SETTYPE_CLEARSKILLS
- See Also:
-
SETTYPE_SKILL
- See Also:
-
SETTYPE_GAMEINFO
- See Also:
-
SETTYPE_INTERMISSON
- See Also:
-
SETTYPE_AUTOMAP
- See Also:
-
SETTYPE_DOOMEDNUMS
- See Also:
-
SETTYPE_SPAWNNUMS
- See Also:
-
SETTYPE_CONVERSATIONID
- See Also:
-
SETTYPE_DAMAGETYPE
- See Also:
-
-
Constructor Details
-
ZDoomMapInfo
public ZDoomMapInfo()Creates a new, blank ZDoom-style MapInfo.
-
-
Method Details
-
addChild
Creates a new, empty child set at the end of the list of sets.- Parameters:
type- the set type.typeValues- the set type's values (if any).- Returns:
- the created empty set.
- Throws:
IndexOutOfBoundsException- if the index is less than 0 or greater than or equal to the amount of sets in this MapInfo.
-
addChildAt
Creates a new, empty child set to add to at a specific index in the list of sets.- Parameters:
index- the index to add to.type- the set type.typeValues- the set type's values (if any).- Returns:
- the created empty set.
- Throws:
IndexOutOfBoundsException- if the index is less than 0 or greater than or equal to the amount of sets in this MapInfo.
-
getChildAt
Gets a specific typed child set from this MapInfo by its index.- Parameters:
index- the index of the child set.- Returns:
- the child set at the index.
- Throws:
IndexOutOfBoundsException- if the index is less than 0 or greater than or equal to the amount of sets in this MapInfo.
-
removeChildAt
Removes a child set at a specific index.- Parameters:
index- the index.- Returns:
- the removed set.
- Throws:
IndexOutOfBoundsException- if the index is less than 0 or greater than or equal to the amount of sets in this MapInfo.
-
getChildCount
public int getChildCount()- Returns:
- the amount of child sets in this MapInfo.
-
iterator
- Specified by:
iteratorin interfaceIterable<MapInfoData>
-
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.
-