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

Doomwad::Sidedef Class Reference

Inheritance diagram for Doomwad::Sidedef:

Doomwad::WadEntryElement List of all members.

Detailed Description

Represents a single Sidedef in a map.

See also:
Linedef Sector Sidedefs
Sidedefs serve two purposes. First, they attach to a side of a Linedef, which is how they got their name. Five of their attributes define texture properties for that "wall." Second, they give shape to Sectors. A Sector by itself has no shape or form, it just defines properties and gives an ID number. Sidedefs link Sector and Linedef objects, so a Sector can be seen between Linedefs on a map.

Definition at line 75 of file sidedefs.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.
 Sidedef (int16=0, int16=0, const std::string &=NO_TEXTURE, const std::string &=NO_TEXTURE, const std::string &=NO_TEXTURE, uint16=NO_SECTOR) throw ()
 Sidedef 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 ~Sidedef (void) throw ()
 Sidedef destructor.

Public Attributes

std::string lower
 Lower texture name.
std::string middle
 Middle (normal) texture name.
uint16 sector
 Sector number.
std::string upper
 Upper texture name.
int16 x_offset
 X offset of textures.
int16 y_offset
 Y offset of textures.

Static Public Attributes

static const size_t LENGTH = 0x0000001E
 Length of a single record.
static const uint16 NO_SECTOR = 0xFFFF
 Does not belong to a Sector.
static const std::string NO_TEXTURE = "-"
 Value of a texture name when there is no texture (i.e. blank).


Constructor & Destructor Documentation

Sidedef::Sidedef int16  _x = 0,
int16  _y = 0,
const std::string &  _upper = NO_TEXTURE,
const std::string &  _lower = NO_TEXTURE,
const std::string &  _middle = NO_TEXTURE,
uint16  _sector = NO_SECTOR
throw ()
 

Sidedef constructor.

Constructs a Sidedef from a bunch of optional arguments.

Parameters:
_x X offset for textures from the left.
_y Y offset for textures from the top.
_upper Upper texture.
_lower Lower texture.
_middle Middle/normal texture.
_sector Number of the sector this Sidedef faces.

Definition at line 65 of file sidedefs.cpp.


Member Function Documentation

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

Definition at line 76 of file sidedefs.cpp.

References LENGTH.

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

Definition at line 99 of file sidedefs.cpp.

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

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

Definition at line 117 of file sidedefs.cpp.

References lower, middle, sector, upper, x_offset, and y_offset.

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

Definition at line 81 of file sidedefs.cpp.


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