hoa_map::private_map::ActionPathMove Class Reference

Action involving movement between a source and destination tile. More...

#include <map_actions.h>

Inheritance diagram for hoa_map::private_map::ActionPathMove:

Inheritance graph
[legend]
Collaboration diagram for hoa_map::private_map::ActionPathMove:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ActionPathMove (VirtualSprite *sprite)
void Execute ()
 Executes the sprite's action.
void SetDestination (int16 x, int16 y)
 ~ActionPathMove ()

Public Attributes

uint32 current_node
 An index to the path vector containing the node that the sprite is currently on.
PathNode destination
 The destination tile of this path movement.
std::vector< PathNodepath
 The path we need to traverse from source to destination.

Detailed Description

Action involving movement between a source and destination tile.

****************************************************************************

This class enables a sprite to move between a source and a destination node. Pathfinding is done between source and destination via the A* algorithm. Once a path is found, it is saved and then used by the sprite. If the sprite needs to traverse between the same source->destination once again, this path is first checked to make sure it is still valid and if so, it is automatically used once more.

Definition at line 101 of file map_actions.h.


Constructor & Destructor Documentation

hoa_map::private_map::ActionPathMove::ActionPathMove ( VirtualSprite sprite  )  [inline]

Definition at line 116 of file map_actions.h.

hoa_map::private_map::ActionPathMove::~ActionPathMove (  )  [inline]

Definition at line 119 of file map_actions.h.


Member Function Documentation

void hoa_map::private_map::ActionPathMove::Execute (  )  [virtual]

Executes the sprite's action.

Implements hoa_map::private_map::SpriteAction.

Definition at line 41 of file map_actions.cpp.

References hoa_map::MapMode::_current_map, hoa_map::private_map::SpriteAction::_finished, hoa_map::private_map::SpriteAction::_sprite, current_node, destination, hoa_map::private_map::EAST, hoa_map::private_map::VirtualSprite::moving, hoa_map::private_map::NORTH, hoa_map::private_map::NORTHEAST, hoa_map::private_map::NORTHWEST, path, hoa_map::private_map::VirtualSprite::SetDirection(), hoa_map::private_map::SOUTH, hoa_map::private_map::SOUTHEAST, hoa_map::private_map::SOUTHWEST, hoa_map::private_map::WEST, hoa_map::private_map::MapObject::x_position, and hoa_map::private_map::MapObject::y_position.

Here is the call graph for this function:

void hoa_map::private_map::ActionPathMove::SetDestination ( int16  x,
int16  y 
) [inline]

Definition at line 124 of file map_actions.h.

References hoa_map::private_map::PathNode::col, destination, and hoa_map::private_map::PathNode::row.


Member Data Documentation

uint32 hoa_map::private_map::ActionPathMove::current_node

An index to the path vector containing the node that the sprite is currently on.

Definition at line 112 of file map_actions.h.

Referenced by Execute().

PathNode hoa_map::private_map::ActionPathMove::destination

The destination tile of this path movement.

Definition at line 106 of file map_actions.h.

Referenced by Execute(), and SetDestination().

std::vector<PathNode> hoa_map::private_map::ActionPathMove::path

The path we need to traverse from source to destination.

Definition at line 109 of file map_actions.h.

Referenced by Execute().


The documentation for this class was generated from the following files:
Generated on Fri Jul 6 23:14:43 2007 for Hero of Allacrost by  doxygen 1.5.1