Planeshift
psNPCTick Class Reference

The event that makes the NPC brain go TICK. More...

#include <npc.h>

Public Member Functions

 psNPCTick (int offsetticks, NPC *npc)
 
void Remove ()
 
virtual csString ToString () const
 Return a string with information about the event. More...
 
virtual void Trigger ()
 Abstract event processing function. More...
 
- Public Member Functions inherited from psGameEvent
virtual bool CheckTrigger ()
 Called right before a Trigger is called. More...
 
const char * GetType ()
 Return the type that this event where created with. More...
 
virtual bool IsValid ()
 Return the valid flag. More...
 
bool operator< (const psGameEvent &other) const
 
bool operator== (const psGameEvent &other) const
 
bool operator> (const psGameEvent &other) const
 
 psGameEvent (csTicks ticks, int offsetticks, const char *newType)
 Construct a new game event. More...
 
void QueueEvent ()
 Publish the game event to the local program. More...
 
virtual void SetValid (bool valid)
 Set the valid flag. More...
 
virtual ~psGameEvent ()
 

Protected Attributes

NPCnpc
 

Additional Inherited Members

- Public Attributes inherited from psGameEvent
csTicks delayticks
 delay before the event starts More...
 
int id
 id value combined with ticks ensures uniqueness for tree More...
 
csTicks triggerticks
 ticks value when event should be triggered. More...
 
bool valid
 Set this to false if the trigger should not be fired. More...
 
- Static Public Attributes inherited from psGameEvent
static EventManagereventmanager
 
static int nextid
 id counter sequence More...
 

Detailed Description

The event that makes the NPC brain go TICK.

Definition at line 894 of file npc.h.

Constructor & Destructor Documentation

psNPCTick::psNPCTick ( int  offsetticks,
NPC npc 
)
inline

Definition at line 900 of file npc.h.

Member Function Documentation

void psNPCTick::Remove ( )
inline

Definition at line 911 of file npc.h.

virtual csString psNPCTick::ToString ( ) const
inlinevirtual

Return a string with information about the event.

Used for debugging to be able to identify things like way did this event take so long to execute.

TODO: Make this function abstract. But for now return "".

Reimplemented from psGameEvent.

Definition at line 917 of file npc.h.

virtual void psNPCTick::Trigger ( )
inlinevirtual

Abstract event processing function.

This functino have to be overridden and will be called if CheckTrigger is ok at the time given in the constructor.

Implements psGameEvent.

Definition at line 902 of file npc.h.

Member Data Documentation

NPC* psNPCTick::npc
protected

Definition at line 897 of file npc.h.


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