Class HexenThing
java.lang.Object
net.mtrop.doom.map.data.HexenThing
- All Implemented Interfaces:
- BinaryObject
Hexen 20-byte format implementation of Thing.
- Author:
- Matthew Tropiano
- 
Nested Class SummaryNested classes/interfaces inherited from interface net.mtrop.doom.object.BinaryObjectBinaryObject.InlineScanner<BO extends BinaryObject>, BinaryObject.Reflect, BinaryObject.Scanner<BO extends BinaryObject>, BinaryObject.Shared, BinaryObject.Transformer<BO extends BinaryObject>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected intThing angle.protected int[]Thing action special arguments.protected intBehavior bitflags.protected intThing Z position relative to sector plane.protected intThing ID.static final intByte length of this object.protected intThing action special.protected intThing type (editor number).protected intThing X position.protected intThing Y position.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintgetAngle()intgetArgument(int n) Gets a special argument.int[]Gets the special arguments copied into a new array.intgetFlags()intintgetId()intintgetType()intgetX()intgetY()booleanisFlagSet(int flagType) Check's if a flag bit is set.voidreadBytes(InputStream in) Reads from anInputStreamand sets this object's fields.voidset(int x, int y) Sets the coordinates of this thing.voidsetAngle(int angle) Sets the angle (in degrees).voidsetArguments(int... arguments) Sets the special arguments.voidsetFlag(int flagType, boolean set) Sets/clears a bit flag.voidsetFlags(int flags) Sets/replaces this linedef's full bitflags.voidsetHeight(int height) Sets the Z position relative to sector plane.voidsetId(int id) Sets the thing's id.voidsetSpecial(int special) Sets the special action for this thing.voidsetType(int type) Sets thing type (a.k.a.voidsetX(int x) Sets the position X-coordinate.voidsetY(int y) Sets the position Y-coordinate.toString()voidwriteBytes(OutputStream out) Writes this object to anOutputStream.
- 
Field Details- 
LENGTHpublic static final int LENGTHByte length of this object.- See Also:
 
- 
idprotected int idThing ID.
- 
heightprotected int heightThing Z position relative to sector plane.
- 
specialprotected int specialThing action special.
- 
argumentsprotected int[] argumentsThing action special arguments.
- 
xprotected int xThing X position.
- 
yprotected int yThing Y position.
- 
angleprotected int angleThing angle.
- 
typeprotected int typeThing type (editor number).
- 
flagsprotected int flagsBehavior bitflags.
 
- 
- 
Constructor Details- 
HexenThingpublic HexenThing()Creates a new thing.
 
- 
- 
Method Details- 
getHeightpublic int getHeight()- Returns:
- the Z position relative to sector plane.
- Since:
- 2.9.0, for naming clarity/uniformity.
 
- 
setHeightpublic void setHeight(int height) Sets the Z position relative to sector plane.- Parameters:
- height- the new height.
- Throws:
- IllegalArgumentException- if- zis not between -32768 and 32767.
- Since:
- 2.9.0, for naming clarity/uniformity.
 
- 
getIdpublic int getId()- Returns:
- the thing's id (for tagged specials).
 
- 
setIdpublic void setId(int id) Sets the thing's id.- Parameters:
- id- the new id.
- Throws:
- IllegalArgumentException- if- idis not between 0 and 65535.
 
- 
getSpecialpublic int getSpecial()- Returns:
- the special action for this thing.
 
- 
setSpecialpublic void setSpecial(int special) Sets the special action for this thing.- Parameters:
- special- the thing special to call on activation.
- Throws:
- IllegalArgumentException- if special is outside the range 0 to 255.
 
- 
getArgumentspublic int[] getArguments()Gets the special arguments copied into a new array.- Returns:
- gets the array of special arguments.
 
- 
getArgumentpublic int getArgument(int n) Gets a special argument.- Parameters:
- n- the argument index (up to 4)
- Returns:
- the argument value.
- Throws:
- ArrayIndexOutOfBoundsException- if- nis less than 0 or greater than 4.
 
- 
setArgumentspublic void setArguments(int... arguments) Sets the special arguments.- Parameters:
- arguments- the argument values to set.
- Throws:
- IllegalArgumentException- if length of arguments is greater than 5, or any argument is less than 0 or greater than 255.
 
- 
readBytesDescription 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 interface- BinaryObject
- Parameters:
- in- the- InputStreamto read from.
- Throws:
- IOException- if a read error occurs.
 
- 
writeBytesDescription copied from interface:BinaryObjectWrites this object to anOutputStream.- Specified by:
- writeBytesin interface- BinaryObject
- Parameters:
- out- the- OutputStreamto write to.
- Throws:
- IOException- if a write error occurs.
 
- 
toString
- 
setpublic void set(int x, int y) Sets the coordinates of this thing.- Parameters:
- x- the x-coordinate value.
- y- the y-coordinate value.
 
- 
getXpublic int getX()- Returns:
- the position X-coordinate.
 
- 
setXpublic void setX(int x) Sets the position X-coordinate.- Parameters:
- x- the new x-coordinate.
- Throws:
- IllegalArgumentException- if x is outside of the range -32768 to 32767.
 
- 
getYpublic int getY()- Returns:
- the position Y-coordinate.
 
- 
setYpublic void setY(int y) Sets the position Y-coordinate.- Parameters:
- y- the new y-coordinate.
- Throws:
- IllegalArgumentException- if y is outside of the range -32768 to 32767.
 
- 
getAnglepublic int getAngle()- Returns:
- the angle (in degrees).
 
- 
setAnglepublic void setAngle(int angle) Sets the angle (in degrees).- Parameters:
- angle- the new angle in degrees.
- Throws:
- IllegalArgumentException- if angle is outside of the range -32768 to 32767.
 
- 
getTypepublic int getType()- Returns:
- thing type (a.k.a. editor number).
 
- 
setTypepublic void setType(int type) Sets thing type (a.k.a. editor number).- Parameters:
- type- the new thing type.
- Throws:
- IllegalArgumentException- if type is outside of the range 0 to 65535.
 
- 
getFlagspublic int getFlags()- Returns:
- this linedef's full bitflags.
 
- 
setFlagspublic void setFlags(int flags) Sets/replaces this linedef's full bitflags.- Parameters:
- flags- the flags to set
 
- 
isFlagSetpublic boolean isFlagSet(int flagType) Check's if a flag bit is set.- Parameters:
- flagType- the flag type (constant).
- Returns:
- true if set, false if not.
- See Also:
 
- 
setFlagpublic void setFlag(int flagType, boolean set) Sets/clears a bit flag.- Parameters:
- flagType- the flag type (constant).
- set- if true, set the bit. If false, clear it.
- See Also:
 
 
-