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

Doomwad::Linedef Class Reference

Inheritance diagram for Doomwad::Linedef:

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

Detailed Description

Represents a single Linedef in a map.

See also:
HexenLinedef Linedefs Sidedef Vertex
Linedefs have several properties. First, they exist between two Vertexes. They may have one of several flags that set its options, and they may be linked to Sectors via a tag. They may have types that determine what, if any, actions it will perform when triggered. Finally, it has links to one or two Sidedefs that give it texture properties and link it to Sectors.

Fields: 2 bytes: start Vertex.
2 bytes: end Vertex.
2 bytes: flags: properties such as impassible, block monsters, block sound.
2 bytes: Sector tag: sector affected when this line is activated by walking, shooting, or switching). This is not a reference. Any Sector sharing this tag is affected.
2 bytes: sidedef1 reference (right side).
2 bytes: sidedef2 reference (left side).
2 bytes: type, e.g. door, raise floor, lower ceiling.

Definition at line 93 of file linedefs.hpp.

Public Member Functions

virtual size_t getLength (void) const throw ()
 Get the length of an element.
 Linedef (uint16=0xFFFF, uint16=0xFFFF, uint16=IMPASSIBLE, uint16=0, uint16=NOSIDEDEF, uint16=NOSIDEDEF, uint16=0) throw ()
 Linedef 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 ~Linedef (void) throw ()
 Linedef destructor.

Public Attributes

uint16 end
 Ending vertex.
uint16 flags
 Flags, for example, impassible, blocks sound, lower unpegged.
uint16 sidedef1
 Sidedef number 1, inside/right. -1/0xFFFF for none.
uint16 sidedef2
 Sidedef number 2, outside/left. -1/0xFFFF for none.
uint16 start
 Starting vertex.
uint16 tag
uint16 type
 Type, for example, door, switch. Zero for normal.

Static Public Attributes

static const uint16 ACTION_PASSTHROUGH = 0x0200
 Allow actions to pass through this Linedef (Boom).
static const uint16 ALWAYS_MAPPED = 0x0100
 Always on map flag.
static const uint16 BLOCK_MONSTER = 0x0002
 Monster block flag.
static const uint16 BLOCK_SOUND = 0x0040
 Blocks sound flag. Need two linedefs to block sound.
static const uint16 IMPASSIBLE = 0x0001
 Impassible flag.
static const uint16 INVISIBLE = 0x0080
 Invisible on map flag.
static const size_t LENGTH = 0x0000000E
 Length of a single record.
static const uint16 NOSIDEDEF = 0xFFFF
 Sidedef ID used for no sidedef.
static const uint16 SECRET = 0x0020
 Secret flag.
static const uint16 TWOSIDED = 0x0004
 Two-sided flag.
static const uint16 UNPEG_LOWER = 0x0010
 Lower texture unpegged flag.
static const uint16 UNPEG_UPPER = 0x0008
 Upper texture unpegged flag.


Constructor & Destructor Documentation

Linedef::Linedef uint16  _start = 0xFFFF,
uint16  _end = 0xFFFF,
uint16  _flags = IMPASSIBLE,
uint16  _tag = 0,
uint16  _sidedef1 = NOSIDEDEF,
uint16  _sidedef2 = NOSIDEDEF,
uint16  _type = 0
throw ()
 

Linedef constructor.

Constructs a Linedef from optional integers.

Parameters:
_start Starting Vertex (origin).
_end Ending Vertex.
_flags Flags. Use class constants.
_tag Sector tag.
_sidedef1 First sidedef (right).
_sidedef2 Second sidedef (left).
_type Optional special type (e.g. door trigger).

Definition at line 92 of file linedefs.cpp.

Linedef::~Linedef void   )  throw () [virtual]
 

Linedef destructor.

Destroys a Linedef object.

Definition at line 101 of file linedefs.cpp.


Member Function Documentation

size_t Linedef::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::HexenLinedef.

Definition at line 105 of file linedefs.cpp.

References LENGTH.

bool Linedef::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::HexenLinedef.

Definition at line 129 of file linedefs.cpp.

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

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

Definition at line 148 of file linedefs.cpp.

References end, flags, sidedef1, sidedef2, start, tag, and type.

bool Linedef::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::HexenLinedef.

Definition at line 110 of file linedefs.cpp.


Member Data Documentation

uint16 Doomwad::Linedef::tag
 

Sector tag, i.e. which Sector is triggered by this Linedef. Zero for none.

Definition at line 144 of file linedefs.hpp.

Referenced by toString().


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