Planeshift
SpawnRange Class Reference

This class is used to store respawn ranges for NPCs. More...

#include <spawnmanager.h>

Public Member Functions

float GetArea ()
 Get range's XZ area. More...
 
int GetID ()
 
const csString & GetSector ()
 Get spawn sector name. More...
 
void Initialize (int idval, int spawnruleid, const char *type_code, float rx1, float ry1, float rz1, float rx2, float ry2, float rz2, float radius, const char *sectorname)
 Setup variables and compute area. More...
 
const csVector3 PickPos ()
 Randomly pick a position within the range. More...
 
void SetID (int idval)
 
 SpawnRange ()
 Ctor clears all to zero. More...
 

Protected Attributes

int id
 Unique ID used for ident. More...
 
int npcspawnruleid
 A = Area (rect), L = Line Segment, C = Circle. More...
 
csRandomGen * randomgen
 
csString spawnsector
 Spawn sector name. More...
 
char type
 

Detailed Description

This class is used to store respawn ranges for NPCs.

They are intended to be gathered into a SpawnRule.

Definition at line 43 of file spawnmanager.h.

Constructor & Destructor Documentation

SpawnRange::SpawnRange ( )

Ctor clears all to zero.

Member Function Documentation

float SpawnRange::GetArea ( )
inline

Get range's XZ area.

Definition at line 97 of file spawnmanager.h.

int SpawnRange::GetID ( )
inline

Definition at line 91 of file spawnmanager.h.

const csString& SpawnRange::GetSector ( )
inline

Get spawn sector name.

Definition at line 103 of file spawnmanager.h.

void SpawnRange::Initialize ( int  idval,
int  spawnruleid,
const char *  type_code,
float  rx1,
float  ry1,
float  rz1,
float  rx2,
float  ry2,
float  rz2,
float  radius,
const char *  sectorname 
)

Setup variables and compute area.

const csVector3 SpawnRange::PickPos ( )

Randomly pick a position within the range.

void SpawnRange::SetID ( int  idval)
inline

Definition at line 87 of file spawnmanager.h.

Member Data Documentation

int SpawnRange::id
protected

Unique ID used for ident.

Definition at line 49 of file spawnmanager.h.

int SpawnRange::npcspawnruleid
protected

A = Area (rect), L = Line Segment, C = Circle.

Corresponding spawn rule ID

Definition at line 54 of file spawnmanager.h.

csRandomGen* SpawnRange::randomgen
protected

Definition at line 46 of file spawnmanager.h.

csString SpawnRange::spawnsector
protected

Spawn sector name.

Definition at line 57 of file spawnmanager.h.

char SpawnRange::type
protected

Definition at line 51 of file spawnmanager.h.


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