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

Doomwad::Thing Class Reference

Inheritance diagram for Doomwad::Thing:

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

Detailed Description

Represents a single Thing in a map.

See also:
HexenThing Things
Things are anything in a map that is not nailed down. They are players, monsters, ammo, weapons, dead bodies, lights, and more. They can face one of eight angles, can appear in various difficulty settings, and can be one of many types.

Definition at line 77 of file things.hpp.

Public Member Functions

virtual size_t getLength (void) const throw ()
 Get the length of an element.
virtual bool read (const Lump &lump, Lump::size_type i) throw ()
 Read this element from a Lump.
 Thing (int16=0, int16=0, uint16=EAST, uint16=0, uint16=0) throw ()
 Default Thing constructor.
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 ~Thing (void) throw ()
 Thing destructor.

Public Attributes

uint16 angle
 Angle, 0 is east. Use static constants for best results.
uint16 flags
 Flags, for example, deaf, skill level, multiplayer.
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 BOOM_NOCO = 0x0040
 Not in cooperative (Boom).
static const uint16 BOOM_NODM = 0x0020
 Not in deathmatch (Boom).
static const uint16 DEAF = 0x0008
 Deaf.
static const uint16 EAST = 0x0000
 East angle.
static const size_t LENGTH = 0x0000000A
 Length of a single record.
static const uint16 MBF_FRIENDLY = 0x0080
 Friendly (MBF).
static const uint16 MULTI = 0x0010
 Multiplayer only.
static const uint16 NORTH = 0x005A
 North angle.
static const uint16 NORTHEAST = 0x002D
 North East angle.
static const uint16 NORTHWEST = 0x0087
 North West angle.
static const uint16 SKILL1 = 0x0001
 I'm Too Young to Die.
static const uint16 SKILL2 = 0x0002
 Hurt Me Plenty.
static const uint16 SKILL3 = 0x0004
 Ultra-Violence and Nightmare.
static const uint16 SOUTH = 0x010E
 South angle.
static const uint16 SOUTHEAST = 0x013B
 South East angle.
static const uint16 SOUTHWEST = 0x00E1
 South West angle.
static const uint16 WEST = 0x00B4
 West angle.


Constructor & Destructor Documentation

Thing::Thing int16  _x = 0,
int16  _y = 0,
uint16  _angle = EAST,
uint16  _type = 0,
uint16  _flags = 0
throw ()
 

Default Thing constructor.

Constructs a new Thing using the given parameters.

Parameters:
_x X coordinate.
_y Y coordinate.
_angle Which direction it faces.
_type What it is.
_flags Flags describing when and how it appears.

Definition at line 92 of file things.cpp.


Member Function Documentation

size_t Thing::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.

Implements Doomwad::WadEntryElement.

Reimplemented in Doomwad::HexenThing.

Definition at line 103 of file things.cpp.

References LENGTH.

bool Thing::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.

Implements Doomwad::WadEntryElement.

Reimplemented in Doomwad::HexenThing.

Definition at line 125 of file things.cpp.

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

std::string Thing::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.

Implements Doomwad::WadEntryElement.

Reimplemented in Doomwad::HexenThing.

Definition at line 142 of file things.cpp.

References angle, flags, type, x, and y.

bool Thing::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.

Implements Doomwad::WadEntryElement.

Reimplemented in Doomwad::HexenThing.

Definition at line 108 of file things.cpp.


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