Class Reject
java.lang.Object
net.mtrop.doom.map.data.Reject
- All Implemented Interfaces:
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
-
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> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetSectorIsVisibleTo(int sectorIndex, int targetSectorIndex) Checks whether a sector is visible from another.voidreadBytes(InputStream in) Reads from anInputStreamand sets this object's fields.voidsetSectorIsVisibleTo(int sectorIndex, int targetSectorIndex, boolean flag) Sets whether a sector is visible from another.voidwriteBytes(OutputStream out) Writes this object to anOutputStream.
-
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
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.
-