Package net.mtrop.doom.map.data
Class DoomSector
java.lang.Object
net.mtrop.doom.map.data.DoomSector
- All Implemented Interfaces:
BinaryObject
Doom/Boom 26-byte format implementation of Sector.
- 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
Modifier and TypeFieldDescriptionprotected int
Sector Ceiling height.protected int
Sector Floor height.static final int
Byte length of this object.protected int
Sector light level.protected int
Sector special.protected int
Sector tag.protected String
Sector Ceiling texture.protected String
Sector Floor texture. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
int
int
int
int
getTag()
void
readBytes
(InputStream in) Reads from anInputStream
and sets this object's fields.void
setHeightCeiling
(int heightCeiling) Sets the sector's ceiling height.void
setHeightFloor
(int heightFloor) Sets this sector's floor height.void
setLightLevel
(int lightLevel) Sets the sector's light level.void
setSpecial
(int special) Sets the sector's special.void
setTag
(int tag) Sets the sector's tag.void
setTextureCeiling
(String textureCeiling) Sets the sector's ceiling texture.void
setTextureFloor
(String textureFloor) Sets the sector's floor texture.toString()
void
writeBytes
(OutputStream out) Writes this object to anOutputStream
.
-
Field Details
-
LENGTH
public static final int LENGTHByte length of this object.- See Also:
-
heightFloor
protected int heightFloorSector Floor height. -
heightCeiling
protected int heightCeilingSector Ceiling height. -
textureFloor
Sector Floor texture. -
textureCeiling
Sector Ceiling texture. -
lightLevel
protected int lightLevelSector light level. -
special
protected int specialSector special. -
tag
protected int tagSector tag.
-
-
Constructor Details
-
DoomSector
public DoomSector()Creates a new sector.
-
-
Method Details
-
setHeightFloor
public void setHeightFloor(int heightFloor) Sets this sector's floor height.- Parameters:
heightFloor
- the new height.- Throws:
IllegalArgumentException
- if floorHeight is outside of the range -32768 to 32767.- Since:
- 2.9.0, naming convention change.
-
getHeightFloor
public int getHeightFloor()- Returns:
- the sector's floor height.
- Since:
- 2.9.0, naming convention change.
-
setHeightCeiling
public void setHeightCeiling(int heightCeiling) Sets the sector's ceiling height.- Parameters:
heightCeiling
- the new height.- Throws:
IllegalArgumentException
- if floorHeight is outside of the range -32768 to 32767.- Since:
- 2.9.0, naming convention change.
-
getHeightCeiling
public int getHeightCeiling()- Returns:
- the sector's ceiling height.
- Since:
- 2.9.0, naming convention change.
-
setTextureFloor
Sets the sector's floor texture.- Parameters:
textureFloor
- the new texture.- Throws:
IllegalArgumentException
- if the texture name is invalid.
-
getTextureFloor
- Returns:
- the sector's floor texture.
-
setTextureCeiling
Sets the sector's ceiling texture.- Parameters:
textureCeiling
- the new texture.- Throws:
IllegalArgumentException
- if the texture name is invalid.
-
getTextureCeiling
- Returns:
- the sector's ceiling texture.
-
setLightLevel
public void setLightLevel(int lightLevel) Sets the sector's light level.- Parameters:
lightLevel
- the new light level.- Throws:
IllegalArgumentException
- if lightLevel is outside the range -32768 to 32767.
-
getLightLevel
public int getLightLevel()- Returns:
- the sector's light level.
-
setSpecial
public void setSpecial(int special) Sets the sector's special.- Parameters:
special
- the new special number.- Throws:
IllegalArgumentException
- if special is outside the range -32768 to 32767.
-
getSpecial
public int getSpecial()- Returns:
- the sector's special.
-
setTag
public void setTag(int tag) Sets the sector's tag.- Parameters:
tag
- the new tag.- Throws:
IllegalArgumentException
- if tag is outside the range -32768 to 32767.
-
getTag
public int getTag()- Returns:
- the sector's tag.
-
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
-