Planeshift
LocationManager Class Reference

Manager that manage all locations and location types. More...

#include <location.h>

Public Member Functions

LocationCreateLocation (iDataConnection *db, LocationType *locationType, const char *locationName, const csVector3 &pos, iSector *sector, float radius, float rot_angle, const csString &flags)
 Create a new location. More...
 
LocationCreateLocation (const char *locationTypeName, const char *locationName, const csVector3 &pos, iSector *sector, float radius, float rot_angle, const csString &flags)
 Create a new location. More...
 
LocationCreateLocation (LocationType *locationType, const char *locationName, const csVector3 &pos, iSector *sector, float radius, float rot_angle, const csString &flags)
 Create a new location. More...
 
LocationTypeCreateLocationType (iDataConnection *db, const csString &locationName)
 Create a new location type. More...
 
LocationTypeCreateLocationType (const csString &locationName)
 Create a new location type. More...
 
LocationTypeCreateLocationType (int id, const csString &locationName)
 Create a new location type. More...
 
LocationTypeFindLocation (const char *typeName)
 Find a location with a given name. More...
 
LocationFindLocation (const char *typeName, const char *name)
 This function handles the searching for the specified object type and basically does the work for the <locate> script command. More...
 
LocationFindLocation (LocationType *type, const char *name)
 Find a location of a specfic location type by nam. More...
 
LocationFindLocation (int id)
 Find a location of a specfic location type by nam. More...
 
size_t FindLocationsInSector (iEngine *engine, iSector *sector, csList< Location * > &list)
 Find all location in given sector. More...
 
LocationFindNearestLocation (psWorld *world, csVector3 &pos, iSector *sector, float range, float *found_range)
 Find the neares location to a point. More...
 
LocationFindNearestLocation (psWorld *world, const char *typeName, csVector3 &pos, iSector *sector, float range, float *found_range)
 Find the neares location to a point of a given location type. More...
 
LocationFindRandomLocation (psWorld *world, const char *typeName, csVector3 &pos, iSector *sector, float range, float *found_range)
 Find a random location within a given max range. More...
 
LocationTypeFindRegion (const char *regname)
 Find a region with a given name. More...
 
csHash< LocationType *, csString >::GlobalIterator GetIterator ()
 Get a iterator to all Location Types stored in the Location Manager. More...
 
LocationGetLocation (int index)
 Retrive one location from this manager by index. More...
 
int GetNumberOfLocations () const
 Retrive the number of locations in this manager. More...
 
bool Load (iEngine *engine, iDataConnection *db)
 Load all locations from DB. More...
 
 LocationManager ()
 Constructor. More...
 
bool RemoveLocationType (iDataConnection *db, const csString &locationName)
 Remove a location type. More...
 
bool RemoveLocationType (const csString &locationName)
 Remove a location type. More...
 
virtual ~LocationManager ()
 Destructor. More...
 

Detailed Description

Manager that manage all locations and location types.

Definition at line 353 of file location.h.

Constructor & Destructor Documentation

LocationManager::LocationManager ( )

Constructor.

virtual LocationManager::~LocationManager ( )
virtual

Destructor.

Member Function Documentation

Location* LocationManager::CreateLocation ( iDataConnection *  db,
LocationType locationType,
const char *  locationName,
const csVector3 &  pos,
iSector *  sector,
float  radius,
float  rot_angle,
const csString &  flags 
)

Create a new location.

And add it to the DB.

Location* LocationManager::CreateLocation ( const char *  locationTypeName,
const char *  locationName,
const csVector3 &  pos,
iSector *  sector,
float  radius,
float  rot_angle,
const csString &  flags 
)

Create a new location.

Location* LocationManager::CreateLocation ( LocationType locationType,
const char *  locationName,
const csVector3 &  pos,
iSector *  sector,
float  radius,
float  rot_angle,
const csString &  flags 
)

Create a new location.

LocationType* LocationManager::CreateLocationType ( iDataConnection *  db,
const csString &  locationName 
)

Create a new location type.

LocationType* LocationManager::CreateLocationType ( const csString &  locationName)

Create a new location type.

LocationType* LocationManager::CreateLocationType ( int  id,
const csString &  locationName 
)

Create a new location type.

LocationType* LocationManager::FindLocation ( const char *  typeName)

Find a location with a given name.

This function handles the searching for the specified location type so that other functions can refer to the location type directly.

Location* LocationManager::FindLocation ( const char *  typeName,
const char *  name 
)

This function handles the searching for the specified object type and basically does the work for the <locate> script command.

Location* LocationManager::FindLocation ( LocationType type,
const char *  name 
)

Find a location of a specfic location type by nam.

Location* LocationManager::FindLocation ( int  id)

Find a location of a specfic location type by nam.

size_t LocationManager::FindLocationsInSector ( iEngine *  engine,
iSector *  sector,
csList< Location * > &  list 
)

Find all location in given sector.

Location* LocationManager::FindNearestLocation ( psWorld world,
csVector3 &  pos,
iSector *  sector,
float  range,
float found_range 
)

Find the neares location to a point.

Location* LocationManager::FindNearestLocation ( psWorld world,
const char *  typeName,
csVector3 &  pos,
iSector *  sector,
float  range,
float found_range 
)

Find the neares location to a point of a given location type.

Location* LocationManager::FindRandomLocation ( psWorld world,
const char *  typeName,
csVector3 &  pos,
iSector *  sector,
float  range,
float found_range 
)

Find a random location within a given max range.

LocationType* LocationManager::FindRegion ( const char *  regname)

Find a region with a given name.

This function handles the searching for the specified region name so that other functions can refer to the region directly.

csHash<LocationType*, csString>::GlobalIterator LocationManager::GetIterator ( )

Get a iterator to all Location Types stored in the Location Manager.

Location* LocationManager::GetLocation ( int  index)

Retrive one location from this manager by index.

int LocationManager::GetNumberOfLocations ( ) const

Retrive the number of locations in this manager.

bool LocationManager::Load ( iEngine *  engine,
iDataConnection *  db 
)

Load all locations from DB.

bool LocationManager::RemoveLocationType ( iDataConnection *  db,
const csString &  locationName 
)

Remove a location type.

bool LocationManager::RemoveLocationType ( const csString &  locationName)

Remove a location type.


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