Planeshift
Public Member Functions | Public Attributes

LocationType Class Reference

This stores a vector of positions listing a set of points defining a common type of location, such as a list of burning fires or guard stations--whatever the NPCs need. More...

#include <location.h>

List of all members.

Public Member Functions

void AddLocation (Location *location)
 Add a new location to this location type.
bool CheckWithinBounds (iEngine *engine, const csVector3 &pos, const iSector *sector)
 Check if a point is within any of the locaitons of this location type.
bool CreateUpdate (iDataConnection *db)
 Create or update an entry for this location type in the DB.
int GetID () const
 retrive the ID of this location type.
const char * GetName () const
 retrive the name of this location type.
bool GetRandomPosition (iEngine *engine, csVector3 &pos, iSector *&sector, const iSector *inSector)
 Get a random position in the location.
bool Import (iDocumentNode *node, iDataConnection *db)
bool ImportLocations (iDocumentNode *node, iDataConnection *db)
bool Load (iDocumentNode *node)
 Load a location type from an XML file.
bool Load (iResultRow &row, iEngine *engine, iDataConnection *db)
 Load a location type from DB.
 LocationType (int id, const csString &name)
 Constructor.
 LocationType ()
 Constructor.
void RemoveLocation (Location *location)
 Remove a location from this location type.
 ~LocationType ()
 Destructor.

Public Attributes

int id
 The DB ID of this location type.
csArray< Location * > locs
 All the location of this location type.
csString name
 The name of this location type.

Detailed Description

This stores a vector of positions listing a set of points defining a common type of location, such as a list of burning fires or guard stations--whatever the NPCs need.

Definition at line 275 of file location.h.


Constructor & Destructor Documentation

LocationType::LocationType ( )

Constructor.

LocationType::LocationType ( int  id,
const csString &  name 
)

Constructor.

LocationType::~LocationType ( )

Destructor.


Member Function Documentation

void LocationType::AddLocation ( Location location)

Add a new location to this location type.

bool LocationType::CheckWithinBounds ( iEngine *  engine,
const csVector3 &  pos,
const iSector *  sector 
)

Check if a point is within any of the locaitons of this location type.

bool LocationType::CreateUpdate ( iDataConnection *  db)

Create or update an entry for this location type in the DB.

Note:
Will update if there is a id different from -1.
int LocationType::GetID ( ) const [inline]

retrive the ID of this location type.

Definition at line 337 of file location.h.

const char* LocationType::GetName ( ) const [inline]

retrive the name of this location type.

Definition at line 344 of file location.h.

bool LocationType::GetRandomPosition ( iEngine *  engine,
csVector3 &  pos,
iSector *&  sector,
const iSector *  inSector 
)

Get a random position in the location.

Will return the position found. Do not relay on the state of the parameters if operation failes.

Parameters:
engineUsed to find the sector
posThe found position is returned here.
sectorThe found sector is returned here.
inSectorIf set, only search for random pos in this sector.
Returns:
True if position is found.
bool LocationType::Import ( iDocumentNode *  node,
iDataConnection *  db 
)
bool LocationType::ImportLocations ( iDocumentNode *  node,
iDataConnection *  db 
)
bool LocationType::Load ( iDocumentNode *  node)

Load a location type from an XML file.

bool LocationType::Load ( iResultRow &  row,
iEngine *  engine,
iDataConnection *  db 
)

Load a location type from DB.

void LocationType::RemoveLocation ( Location location)

Remove a location from this location type.


Member Data Documentation

The DB ID of this location type.

Definition at line 278 of file location.h.

All the location of this location type.

Definition at line 280 of file location.h.

The name of this location type.

Definition at line 279 of file location.h.


The documentation for this class was generated from the following file: