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
FieldsModifier and TypeFieldDescriptionprotected intSector Ceiling height.protected intSector Floor height.static final intByte length of this object.protected intSector light level.protected intSector special.protected intSector tag.protected StringSector Ceiling texture.protected StringSector Floor texture. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintintintgetTag()voidreadBytes(InputStream in) Reads from anInputStreamand sets this object's fields.voidsetHeightCeiling(int heightCeiling) Sets the sector's ceiling height.voidsetHeightFloor(int heightFloor) Sets this sector's floor height.voidsetLightLevel(int lightLevel) Sets the sector's light level.voidsetSpecial(int special) Sets the sector's special.voidsetTag(int tag) Sets the sector's tag.voidsetTextureCeiling(String textureCeiling) Sets the sector's ceiling texture.voidsetTextureFloor(String textureFloor) Sets the sector's floor texture.toString()voidwriteBytes(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: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
-