Planeshift
|
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>
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 *§or, 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. |
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.
LocationType::LocationType | ( | ) |
Constructor.
LocationType::LocationType | ( | int | id, |
const csString & | name | ||
) |
Constructor.
LocationType::~LocationType | ( | ) |
Destructor.
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.
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.
engine | Used to find the sector |
pos | The found position is returned here. |
sector | The found sector is returned here. |
inSector | If set, only search for random pos in this sector. |
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.
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.
csString LocationType::name |
The name of this location type.
Definition at line 279 of file location.h.