Class DoomSidedef

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

public class DoomSidedef extends Object implements BinaryObject
Doom/Boom 30-byte format implementation of a Sidedef.
Author:
Matthew Tropiano
  • Field Details

  • 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

      public void setTextureTop(String textureTop)
      Sets the top texture name.
      Parameters:
      textureTop - the new texture name.
      Throws:
      IllegalArgumentException - if the texture name is invalid.
    • getTextureTop

      public String getTextureTop()
      Returns:
      the top texture name.
    • setTextureBottom

      public void setTextureBottom(String textureBottom)
      Sets the bottom texture name.
      Parameters:
      textureBottom - the new texture name.
      Throws:
      IllegalArgumentException - if the texture name is invalid.
    • getTextureBottom

      public String getTextureBottom()
      Returns:
      the bottom texture name.
    • setTextureMiddle

      public void setTextureMiddle(String textureMiddle)
      Sets the middle texture name.
      Parameters:
      textureMiddle - the new texture name.
      Throws:
      IllegalArgumentException - if the texture name is invalid.
    • getTextureMiddle

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

      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