Planeshift
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

WanderOperation Class Reference

Wander auto-navigates randomly between a network of waypoints specified in the DB. More...

#include <npcoperations.h>

List of all members.

Classes

class  WanderRouteFilter

Public Member Functions

virtual OperationResult Advance (float timedelta, NPC *npc)
void EdgeListClear ()
 Clear list of edges.
psPathPointGetCurrentPathPoint (NPC *npc)
 Return the current path point.
EdgeGetNextEdge (NPC *npc)
 Get the next edge for local destination.
psPathPointGetNextPathPoint (NPC *npc, bool &teleport)
 Get the next path point to use for local destination.
virtual void InterruptOperation (NPC *npc)
virtual bool Load (iDocumentNode *node)
virtual ScriptOperationMakeCopy ()
virtual OperationResult Run (NPC *npc, bool interrupted)
 WanderOperation (const WanderOperation *other)
 WanderOperation ()
virtual ~WanderOperation ()

Static Public Member Functions

static float DistanceToDestPoint (NPC *npc, const csVector3 &destPos, const iSector *destSector)

Protected Member Functions

OperationResult CalculateEdgeList (NPC *npc)
 Calculate the edgeList to be used by wander.
bool MoveTo (NPC *npc, psPathPoint *point)
 Teleport to point.
void SetPathPointIterator (Edge::Iterator *iterator)
 Set the current path point iterator.
bool StartMoveTo (NPC *npc, psPathPoint *point)
 Start move to point.

Protected Attributes

csString action
bool city
bool cityValid
float currentDistance
 The distance to the current local destination.
EdgecurrentEdge
 The current edge.
psPathPointcurrentPathPoint
 The current local destination.
Edge::IteratorcurrentPathPointIterator
 The current iterator for path points.
csVector3 currentPointOffset
 The offset used for current local dest.
csList< Edge * >::Iterator edgeIterator
csList< Edge * > edgeList
bool ground
bool groundValid
bool indoor
bool indoorValid
bool path
bool pathValid
bool priv
bool privValid
bool pub
bool pubValid
bool random
bool road
bool roadValid
bool underground
bool undergroundValid
bool underwater
bool underwaterValid
WanderRouteFilter wanderRouteFilter

Detailed Description

Wander auto-navigates randomly between a network of waypoints specified in the DB.

Definition at line 1720 of file npcoperations.h.


Constructor & Destructor Documentation

WanderOperation::WanderOperation ( )
WanderOperation::WanderOperation ( const WanderOperation other)
virtual WanderOperation::~WanderOperation ( ) [virtual]

Member Function Documentation

virtual OperationResult WanderOperation::Advance ( float  timedelta,
NPC npc 
) [virtual]

Reimplemented from ScriptOperation.

OperationResult WanderOperation::CalculateEdgeList ( NPC npc) [protected]

Calculate the edgeList to be used by wander.

Will calculate a list of edges between start and end for wander. For random wander the list is empty but still returning true.

static float WanderOperation::DistanceToDestPoint ( NPC npc,
const csVector3 &  destPos,
const iSector *  destSector 
) [static]
void WanderOperation::EdgeListClear ( ) [inline]

Clear list of edges.

Definition at line 1801 of file npcoperations.h.

psPathPoint* WanderOperation::GetCurrentPathPoint ( NPC npc)

Return the current path point.

Edge* WanderOperation::GetNextEdge ( NPC npc)

Get the next edge for local destination.

Will return the next edge from the edge list or find a new radom edge for random wander.

psPathPoint* WanderOperation::GetNextPathPoint ( NPC npc,
bool &  teleport 
)

Get the next path point to use for local destination.

Will return the next path point from the active edge. It will get next edge when at end of path. This include random edge if operation is random.

virtual void WanderOperation::InterruptOperation ( NPC npc) [virtual]

Reimplemented from ScriptOperation.

virtual bool WanderOperation::Load ( iDocumentNode *  node) [virtual]

Reimplemented from ScriptOperation.

virtual ScriptOperation* WanderOperation::MakeCopy ( ) [virtual]

Implements ScriptOperation.

bool WanderOperation::MoveTo ( NPC npc,
psPathPoint point 
) [protected]

Teleport to point.

Teleport from current position to next local dest point.

virtual OperationResult WanderOperation::Run ( NPC npc,
bool  interrupted 
) [virtual]

Implements ScriptOperation.

void WanderOperation::SetPathPointIterator ( Edge::Iterator iterator) [protected]

Set the current path point iterator.

bool WanderOperation::StartMoveTo ( NPC npc,
psPathPoint point 
) [protected]

Start move to point.

Set up a movement from current position to next local dest point.


Member Data Documentation

csString WanderOperation::action [protected]

Definition at line 1752 of file npcoperations.h.

bool WanderOperation::city [protected]

Definition at line 1758 of file npcoperations.h.

bool WanderOperation::cityValid [protected]

Definition at line 1758 of file npcoperations.h.

The distance to the current local destination.

Definition at line 1744 of file npcoperations.h.

The current edge.

Definition at line 1740 of file npcoperations.h.

The current local destination.

Definition at line 1742 of file npcoperations.h.

The current iterator for path points.

Definition at line 1741 of file npcoperations.h.

csVector3 WanderOperation::currentPointOffset [protected]

The offset used for current local dest.

Definition at line 1743 of file npcoperations.h.

csList<Edge*>::Iterator WanderOperation::edgeIterator [protected]

Definition at line 1739 of file npcoperations.h.

csList<Edge*> WanderOperation::edgeList [protected]

Definition at line 1737 of file npcoperations.h.

bool WanderOperation::ground [protected]

Definition at line 1762 of file npcoperations.h.

bool WanderOperation::groundValid [protected]

Definition at line 1762 of file npcoperations.h.

bool WanderOperation::indoor [protected]

Definition at line 1759 of file npcoperations.h.

bool WanderOperation::indoorValid [protected]

Definition at line 1759 of file npcoperations.h.

bool WanderOperation::path [protected]

Definition at line 1760 of file npcoperations.h.

bool WanderOperation::pathValid [protected]

Definition at line 1760 of file npcoperations.h.

bool WanderOperation::priv [protected]

Definition at line 1756 of file npcoperations.h.

bool WanderOperation::privValid [protected]

Definition at line 1756 of file npcoperations.h.

bool WanderOperation::pub [protected]

Definition at line 1757 of file npcoperations.h.

bool WanderOperation::pubValid [protected]

Definition at line 1757 of file npcoperations.h.

bool WanderOperation::random [protected]

Definition at line 1753 of file npcoperations.h.

bool WanderOperation::road [protected]

Definition at line 1761 of file npcoperations.h.

bool WanderOperation::roadValid [protected]

Definition at line 1761 of file npcoperations.h.

bool WanderOperation::underground [protected]

Definition at line 1754 of file npcoperations.h.

Definition at line 1754 of file npcoperations.h.

bool WanderOperation::underwater [protected]

Definition at line 1755 of file npcoperations.h.

Definition at line 1755 of file npcoperations.h.

Definition at line 1735 of file npcoperations.h.


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