Class DoomSector

java.lang.Object
net.mtrop.doom.map.data.DoomSector
All Implemented Interfaces:
BinaryObject

public class DoomSector extends Object implements BinaryObject
Doom/Boom 26-byte format implementation of Sector.
Author:
Matthew Tropiano
  • Field Details

    • LENGTH

      public static final int LENGTH
      Byte length of this object.
      See Also:
    • heightFloor

      protected int heightFloor
      Sector Floor height.
    • heightCeiling

      protected int heightCeiling
      Sector Ceiling height.
    • textureFloor

      protected String textureFloor
      Sector Floor texture.
    • textureCeiling

      protected String textureCeiling
      Sector Ceiling texture.
    • lightLevel

      protected int lightLevel
      Sector light level.
    • special

      protected int special
      Sector special.
    • tag

      protected int tag
      Sector 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

      public void setTextureFloor(String textureFloor)
      Sets the sector's floor texture.
      Parameters:
      textureFloor - the new texture.
      Throws:
      IllegalArgumentException - if the texture name is invalid.
    • getTextureFloor

      public String getTextureFloor()
      Returns:
      the sector's floor texture.
    • setTextureCeiling

      public void setTextureCeiling(String textureCeiling)
      Sets the sector's ceiling texture.
      Parameters:
      textureCeiling - the new texture.
      Throws:
      IllegalArgumentException - if the texture name is invalid.
    • getTextureCeiling

      public String 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

      public void readBytes(InputStream in) throws IOException
      Description copied from interface: BinaryObject
      Reads from an InputStream 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 interface BinaryObject
      Parameters:
      in - the InputStream to read from.
      Throws:
      IOException - if a read error occurs.
    • writeBytes

      public void writeBytes(OutputStream out) throws IOException
      Description copied from interface: BinaryObject
      Writes this object to an OutputStream.
      Specified by:
      writeBytes in interface BinaryObject
      Parameters:
      out - the OutputStream to write to.
      Throws:
      IOException - if a write error occurs.
    • toString

      public String toString()
      Overrides:
      toString in class Object