#include <map_actions.h>
Inheritance diagram for hoa_map::private_map::ActionPathMove:


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< PathNode > | path |
| The path we need to traverse from source to destination. | |
****************************************************************************
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.
| 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.
| 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:

Definition at line 124 of file map_actions.h.
References hoa_map::private_map::PathNode::col, destination, and hoa_map::private_map::PathNode::row.
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().
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().
1.5.1