Planeshift
PositionPerception Class Reference

Percept a position. More...

#include <perceptions.h>

Public Member Functions

virtual bool GetLocation (csVector3 &pos, iSector *&sector)
 Get a location assosiated with the perception. More...
 
virtual float GetRadius () const
 Get the radius of the perception. More...
 
virtual PerceptionMakeCopy ()
 Make a copy of this perception. More...
 
 PositionPerception (const char *n, const char *type, InstanceID &instance, iSector *sector, csVector3 &pos, float yrot, float radius)
 
virtual ~PositionPerception ()
 
- Public Member Functions inherited from Perception
virtual void ExecutePerception (NPC *npc, float weight)
 All preconditions has been checked, now excecute the perception. More...
 
virtual const csString & GetName () const
 Get the name of the perception. More...
 
virtual gemNPCObjectGetTarget ()
 Some perception has a target/source. More...
 
const csString & GetType () const
 Get the type of the perception. More...
 
 Perception (const char *name)
 Constructor. More...
 
 Perception (const char *name, const char *type)
 Constructor. More...
 
void SetType (const char *type)
 Set the type of the perception. More...
 
virtual bool ShouldReact (Reaction *reaction, NPC *npc)
 Check if this perception should react to a reaction. More...
 
virtual csString ToString (NPC *npc)
 Get a text description of the perception. More...
 
virtual ~Perception ()
 Destructor. More...
 

Protected Attributes

InstanceID instance
 
csVector3 pos
 
float radius
 
iSector * sector
 
float yrot
 
- Protected Attributes inherited from Perception
csString name
 The name of this perception. More...
 
csString type
 Type used by perceptions. Usally they correspond to the same value in a reaction. More...
 

Detailed Description

Percept a position.

Definition at line 278 of file perceptions.h.

Constructor & Destructor Documentation

PositionPerception::PositionPerception ( const char *  n,
const char *  type,
InstanceID instance,
iSector *  sector,
csVector3 &  pos,
float  yrot,
float  radius 
)
inline

Definition at line 289 of file perceptions.h.

virtual PositionPerception::~PositionPerception ( )
inlinevirtual

Definition at line 291 of file perceptions.h.

Member Function Documentation

virtual bool PositionPerception::GetLocation ( csVector3 &  pos,
iSector *&  sector 
)
virtual

Get a location assosiated with the perception.

Some perception might hold a location. Default impl get location from target if there is one.

Parameters
posThe position of the location.
sectorThe sector of the location.
Returns
true if there where a location.

Reimplemented from Perception.

virtual float PositionPerception::GetRadius ( ) const
virtual

Get the radius of the perception.

Reimplemented from Perception.

virtual Perception* PositionPerception::MakeCopy ( )
virtual

Make a copy of this perception.

Returns
the copy.

Reimplemented from Perception.

Member Data Documentation

InstanceID PositionPerception::instance
protected

Definition at line 281 of file perceptions.h.

csVector3 PositionPerception::pos
protected

Definition at line 283 of file perceptions.h.

float PositionPerception::radius
protected

Definition at line 286 of file perceptions.h.

iSector* PositionPerception::sector
protected

Definition at line 282 of file perceptions.h.

float PositionPerception::yrot
protected

Definition at line 284 of file perceptions.h.


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