Planeshift
NPCCmdPerception Class Reference

Whenever an NPC Cmd is received this perception is fired. More...

#include <perceptions.h>

Public Member Functions

virtual PerceptionMakeCopy ()
 Make a copy of this perception. More...
 
 NPCCmdPerception (const char *command, NPC *self)
 
virtual bool ShouldReact (Reaction *reaction, NPC *npc)
 Check if this perception should react to a reaction. More...
 
- 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...
 
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 csString ToString (NPC *npc)
 Get a text description of the perception. More...
 
virtual ~Perception ()
 Destructor. More...
 

Protected Attributes

NPCself
 
- 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 Cmd is received this perception is fired.

This is most typicaly from a response script like: Example:

<npccmd cmd="test_cmd"/>

Definition at line 536 of file perceptions.h.

Constructor & Destructor Documentation

NPCCmdPerception::NPCCmdPerception ( const char *  command,
NPC self 
)

Member Function Documentation

virtual Perception* NPCCmdPerception::MakeCopy ( )
virtual

Make a copy of this perception.

Returns
the copy.

Reimplemented from Perception.

virtual bool NPCCmdPerception::ShouldReact ( Reaction reaction,
NPC npc 
)
virtual

Check if this perception should react to a reaction.

Parameters
reactionThe reaction to check for.
npcThe NPC that might receive this.
Returns
true if reaction should be reacted to.

Reimplemented from Perception.

Member Data Documentation

NPC* NPCCmdPerception::self
protected

Definition at line 539 of file perceptions.h.


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