Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Doomwad::HexenThing Class Reference

Inheritance diagram for Doomwad::HexenThing:

Doomwad::Thing Doomwad::WadEntryElement List of all members.

Detailed Description

Represents a single Thing in a Hexen or ZDoom map.

See also:
HexenThings Thing
HexenThings have several properties, but the important ones are X and Y coordinates and a type.

Definition at line 125 of file things.hpp.

Public Member Functions

virtual size_t getLength (void) const throw ()
 Get the length of an element.
 HexenThing (uint16=0, int16=0, int16=0, int16=0, uint16=EAST, uint16=0, uint16=0, byte=0, byte=0, byte=0, byte=0, byte=0, byte=0) throw ()
 Default HexenThing constructor.
virtual bool read (const Lump &lump, Lump::size_type i) throw ()
 Read this element from a Lump.
virtual std::string toString (void) const throw ()
 Convert this element to a string.
virtual bool write (Lump &lump, Lump::size_type i) const throw ()
 Write this element into a Lump.
virtual ~HexenThing (void) throw ()
 HexenThing destructor.

Public Attributes

uint16 angle
 Angle, 0 is east. Use static constants for best results.
byte arg1
 Argument 1.
byte arg2
 Argument 2.
byte arg3
 Argument 3.
byte arg4
 Argument 4.
byte arg5
 Argument 5.
uint16 flags
 Flags, for example, deaf, skill level, multiplayer.
int16 height
 Starting height.
uint16 id
 Thing ID.
byte special
 Special type.
uint16 type
 Thing type, for example, a player start or a demon.
int16 x
 X coordinate.
int16 y
 Y coordinate.

Static Public Attributes

static const uint16 FRIENDLY = 0x2000
 Friendly to the player.
static const uint16 IN_COOP = 0x0200
 In cooperative mode.
static const uint16 IN_DM = 0x0400
 In deathmatch.
static const uint16 IN_SP = 0x0100
 In single player.
static const uint16 INVISIBLE = 0x1000
 Completely invisible.
static const size_t LENGTH = 0x00000014
 Length of a single record.
static const uint16 STANDSTILL = 0x4000
 Does not move.
static const uint16 TRANSLUCENT = 0x0800
 25% translucent.


Constructor & Destructor Documentation

HexenThing::HexenThing uint16  _id = 0,
int16  _x = 0,
int16  _y = 0,
int16  _height = 0,
uint16  _angle = EAST,
uint16  _type = 0,
uint16  _flags = 0,
byte  _special = 0,
byte  _arg1 = 0,
byte  _arg2 = 0,
byte  _arg3 = 0,
byte  _arg4 = 0,
byte  _arg5 = 0
throw ()
 

Default HexenThing constructor.

Constructs a new HexenThing using the given parameters.

Parameters:
_id tid.
_x X coordinate.
_y Y coordinate.
_height Height where it spawns.
_angle Which direction it faces.
_type What it is.
_flags Flags describing when and how it appears.
_special Special type.
_arg1 Argument 1
_arg2 Argument 2
_arg3 Argument 3
_arg4 Argument 4
_arg5 Argument 5

Definition at line 168 of file things.cpp.


Member Function Documentation

size_t HexenThing::getLength void   )  const throw () [virtual]
 

Get the length of an element.

Each element record type has a length. Some are fixed, in which case this function returns that length. Some records are variable-length, in which case this function returns zero.

Returns:
Length of the record.

Reimplemented from Doomwad::Thing.

Definition at line 179 of file things.cpp.

References LENGTH.

bool HexenThing::read const Lump lump,
Lump::size_type  i
throw () [virtual]
 

Read this element from a Lump.

Read one element from a Lump at the specified index.

Parameters:
lump Reference to the target Lump.
i Index into the Lump's buffer.
Returns:
True if successful, false if not.

Reimplemented from Doomwad::Thing.

Definition at line 209 of file things.cpp.

Referenced by Doomwad::HexenThings::setFromLump().

std::string HexenThing::toString void   )  const throw () [virtual]
 

Convert this element to a string.

The format of the string will vary from class to class, but every subclass must be able to format itself as a string. IMPORTANT: this string representation is not guaranteed to preserve all data. Reading back in is not supported. This function's goal is to make the object's state user-readable, not machine-readable.

Returns:
std::string object containing object state.

Reimplemented from Doomwad::Thing.

Definition at line 234 of file things.cpp.

References angle, arg1, arg2, arg3, arg4, arg5, flags, height, special, type, x, and y.

bool HexenThing::write Lump lump,
Lump::size_type  i
const throw () [virtual]
 

Write this element into a Lump.

Write one element into a Lump at the specified index.

Parameters:
lump Reference to the target Lump.
i Index into the Lump's buffer.
Returns:
True if successful, false if not.

Reimplemented from Doomwad::Thing.

Definition at line 184 of file things.cpp.


Generated on Fri Jun 10 19:38:52 2005 for libdoomwad by  doxygen 1.4.0