Class Reject

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

public class Reject extends Object implements BinaryObject
Represents the Reject lump.

The reject lump is a lookup grid that hold information on what sectors can "see" other sectors on the map used for thing sight algorithms.

Author:
Matthew Tropiano
  • Constructor Details

    • Reject

      public Reject(int sectors)
      Creates a new blank reject grid.
      Parameters:
      sectors - the number of sectors.
  • Method Details

    • getSectorIsVisibleTo

      public boolean getSectorIsVisibleTo(int sectorIndex, int targetSectorIndex)
      Checks whether a sector is visible from another.
      Parameters:
      sectorIndex - the sector index viewing from.
      targetSectorIndex - the sector index viewing into.
      Returns:
      true if so, false if not.
    • setSectorIsVisibleTo

      public void setSectorIsVisibleTo(int sectorIndex, int targetSectorIndex, boolean flag)
      Sets whether a sector is visible from another.
      Parameters:
      sectorIndex - the sector index viewing from.
      targetSectorIndex - the sector index viewing into.
      flag - true if visible, false if not.
    • 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.