Package net.mtrop.doom.map.data
Class DoomSidedef
java.lang.Object
net.mtrop.doom.map.data.DoomSidedef
- All Implemented Interfaces:
BinaryObject
Doom/Boom 30-byte format implementation of a Sidedef.
- 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
int
int
void
readBytes
(InputStream in) Reads from anInputStream
and sets this object's fields.void
setOffsetX
(int offsetX) Sets the sidedef's texture X offset.void
setOffsetY
(int offsetY) Sets the sidedef's texture Y offset.void
setSectorIndex
(int sectorIndex) Sets the sector reference index for this sidedef.void
setTextureBottom
(String textureBottom) Sets the bottom texture name.void
setTextureMiddle
(String textureMiddle) Sets the middle texture name.void
setTextureTop
(String textureTop) Sets the top texture name.toString()
void
writeBytes
(OutputStream out) Writes this object to anOutputStream
.
-
Field Details
-
LENGTH
public static final int LENGTHByte length of this object.- See Also:
-
-
Constructor Details
-
DoomSidedef
public DoomSidedef()Creates a new sidedef.
-
-
Method Details
-
setOffsetX
public void setOffsetX(int offsetX) Sets the sidedef's texture X offset.- Parameters:
offsetX
- the new X offset.- Throws:
IllegalArgumentException
- if the offset is outside the range -32768 to 32767.
-
getOffsetX
public int getOffsetX()- Returns:
- the sidedef's texture X offset.
-
setOffsetY
public void setOffsetY(int offsetY) Sets the sidedef's texture Y offset.- Parameters:
offsetY
- the new Y offset.- Throws:
IllegalArgumentException
- if the offset is outside the range -32768 to 32767.
-
getOffsetY
public int getOffsetY()- Returns:
- the sidedef's texture Y offset.
-
setTextureTop
Sets the top texture name.- Parameters:
textureTop
- the new texture name.- Throws:
IllegalArgumentException
- if the texture name is invalid.
-
getTextureTop
- Returns:
- the top texture name.
-
setTextureBottom
Sets the bottom texture name.- Parameters:
textureBottom
- the new texture name.- Throws:
IllegalArgumentException
- if the texture name is invalid.
-
getTextureBottom
- Returns:
- the bottom texture name.
-
setTextureMiddle
Sets the middle texture name.- Parameters:
textureMiddle
- the new texture name.- Throws:
IllegalArgumentException
- if the texture name is invalid.
-
getTextureMiddle
- Returns:
- the middle texture name.
-
setSectorIndex
public void setSectorIndex(int sectorIndex) Sets the sector reference index for this sidedef.- Parameters:
sectorIndex
- the sector reference index.- Throws:
IllegalArgumentException
- if the offset is outside the range 0 to 65535.
-
getSectorIndex
public int getSectorIndex()- Returns:
- the index of the sector.
-
readBytes
Description copied from interface:BinaryObject
Reads from anInputStream
and 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:
readBytes
in interfaceBinaryObject
- Parameters:
in
- theInputStream
to read from.- Throws:
IOException
- if a read error occurs.
-
writeBytes
Description copied from interface:BinaryObject
Writes this object to anOutputStream
.- Specified by:
writeBytes
in interfaceBinaryObject
- Parameters:
out
- theOutputStream
to write to.- Throws:
IOException
- if a write error occurs.
-
toString
-