Planeshift
ItemPerception Class Reference

Whenever an NPC is close to an item, this perception is passed to the npc. More...

#include <perceptions.h>

Public Member Functions

virtual gemNPCObjectGetTarget ()
 Some perception has a target/source. More...
 
 ItemPerception (const char *n, gemNPCObject *i)
 
virtual PerceptionMakeCopy ()
 Make a copy of this perception. More...
 
virtual ~ItemPerception ()
 
- Public Member Functions inherited from Perception
virtual void ExecutePerception (NPC *npc, float weight)
 All preconditions has been checked, now excecute the perception. More...
 
virtual bool GetLocation (csVector3 &pos, iSector *&sector)
 Get a location assosiated with the perception. More...
 
virtual const csString & GetName () const
 Get the name of the perception. More...
 
virtual float GetRadius () const
 Get the radius of the perception. 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

csWeakRef< gemNPCObjectitem
 
- 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

Whenever an NPC is close to an item, this perception is passed to the npc.

Definition at line 234 of file perceptions.h.

Constructor & Destructor Documentation

ItemPerception::ItemPerception ( const char *  n,
gemNPCObject i 
)
inline

Definition at line 240 of file perceptions.h.

virtual ItemPerception::~ItemPerception ( )
inlinevirtual

Definition at line 242 of file perceptions.h.

Member Function Documentation

virtual gemNPCObject* ItemPerception::GetTarget ( )
inlinevirtual

Some perception has a target/source.

See also
DamagePerception
Returns
the target of this perception.

Reimplemented from Perception.

Definition at line 245 of file perceptions.h.

virtual Perception* ItemPerception::MakeCopy ( )
virtual

Make a copy of this perception.

Returns
the copy.

Reimplemented from Perception.

Member Data Documentation

csWeakRef<gemNPCObject> ItemPerception::item
protected

Definition at line 237 of file perceptions.h.


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