Class DoomLinedef
java.lang.Object
net.mtrop.doom.map.data.DoomLinedef
- All Implemented Interfaces:
BinaryObject
Doom/Boom 14-byte format implementation of Linedef.
- Author:
- Matthew Tropiano
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.mtrop.doom.object.BinaryObject
BinaryObject.InlineScanner<BO extends BinaryObject>, BinaryObject.Reflect, BinaryObject.Scanner<BO extends BinaryObject>, BinaryObject.Shared, BinaryObject.Transformer<BO extends BinaryObject> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intBehavior bitflags.static final intByte length of this object.protected intBack sidedef.protected intFront sidedef.protected intLinedef special.protected intLinedef special tag.protected intVertex end.protected intVertex start. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetFlags()intintintintgetTag()intintbooleanisFlagSet(int flagType) Check's if a flag bit is set.voidreadBytes(InputStream in) Reads from anInputStreamand sets this object's fields.voidsetFlag(int flagType, boolean set) Sets/clears a bit flag.voidsetFlags(int flags) Sets/replaces this linedef's full bitflags.voidsetSidedefBackIndex(int sidedefBackIndex) Sets the back sidedef index.voidsetSidedefFrontIndex(int sidedefFrontIndex) Sets the front sidedef index.voidsetSpecial(int special) Sets the linedef special type.voidsetTag(int tag) Sets this linedef's special tag.voidsetVertexEndIndex(int vertexEndIndex) Sets the ending vertex index.voidsetVertexStartIndex(int vertexStartIndex) Sets the starting vertex index.toString()voidwriteBytes(OutputStream out) Writes this object to anOutputStream.
-
Field Details
-
LENGTH
public static final int LENGTHByte length of this object.- See Also:
-
tag
protected int tagLinedef special tag. -
vertexStartIndex
protected int vertexStartIndexVertex start. -
vertexEndIndex
protected int vertexEndIndexVertex end. -
sidedefFrontIndex
protected int sidedefFrontIndexFront sidedef. -
sidedefBackIndex
protected int sidedefBackIndexBack sidedef. -
flags
protected int flagsBehavior bitflags. -
special
protected int specialLinedef special.
-
-
Constructor Details
-
DoomLinedef
public DoomLinedef()Creates a new linedef.
-
-
Method Details
-
setTag
public void setTag(int tag) Sets this linedef's special tag.- Parameters:
tag- the new tag.
-
getTag
public int getTag()- Returns:
- this linedef's special tag.
-
readBytes
Description copied from interface:BinaryObjectReads from anInputStreamand sets this object's fields. Only reads the amount of bytes that it takes to read a single instance of the object. Note that not every object may have a consistent length!- Specified by:
readBytesin interfaceBinaryObject- Parameters:
in- theInputStreamto read from.- Throws:
IOException- if a read error occurs.
-
writeBytes
Description copied from interface:BinaryObjectWrites this object to anOutputStream.- Specified by:
writeBytesin interfaceBinaryObject- Parameters:
out- theOutputStreamto write to.- Throws:
IOException- if a write error occurs.
-
toString
-
setVertexStartIndex
public void setVertexStartIndex(int vertexStartIndex) Sets the starting vertex index.- Parameters:
vertexStartIndex- the index of the start vertex.- Throws:
IllegalArgumentException- if index is outside the range 0 to 65535.
-
getVertexStartIndex
public int getVertexStartIndex()- Returns:
- the starting vertex index.
-
setVertexEndIndex
public void setVertexEndIndex(int vertexEndIndex) Sets the ending vertex index.- Parameters:
vertexEndIndex- the index of the end vertex.- Throws:
IllegalArgumentException- if index is outside the range 0 to 65535.
-
getVertexEndIndex
public int getVertexEndIndex()- Returns:
- the ending vertex index.
-
setSidedefFrontIndex
public void setSidedefFrontIndex(int sidedefFrontIndex) Sets the front sidedef index.- Parameters:
sidedefFrontIndex- the index of the front sidedef.- Throws:
IllegalArgumentException- if special is outside the range -1 to 32767.
-
getSidedefFrontIndex
public int getSidedefFrontIndex()- Returns:
- the front sidedef index.
-
setSidedefBackIndex
public void setSidedefBackIndex(int sidedefBackIndex) Sets the back sidedef index.- Parameters:
sidedefBackIndex- the index of the back sidedef.- Throws:
IllegalArgumentException- if special is outside the range -1 to 32767.
-
getSidedefBackIndex
public int getSidedefBackIndex()- Returns:
- the back sidedef index.
-
setSpecial
public void setSpecial(int special) Sets the linedef special type.- Parameters:
special- the number of the special.- Throws:
IllegalArgumentException- if special is outside the range 0 to 65535.
-
getSpecial
public int getSpecial()- Returns:
- the linedef special type.
-
getFlags
public int getFlags()- Returns:
- this linedef's full bitflags.
-
setFlags
public void setFlags(int flags) Sets/replaces this linedef's full bitflags.- Parameters:
flags- the flags to set
-
isFlagSet
public boolean isFlagSet(int flagType) Check's if a flag bit is set.- Parameters:
flagType- the flag type (constant).- Returns:
- true if set, false if not.
- See Also:
-
setFlag
public void setFlag(int flagType, boolean set) Sets/clears a bit flag.- Parameters:
flagType- the flag type (constant).set- if true, set the bit. If false, clear it.- See Also:
-