#include <movement.h>
Public Types | |
enum | MovementType { kTypeWalk = 1, kTypeFollowPath = 2, kTypeFollowPathLight = 3, kTypeTurn = 4 } |
Public Member Functions | |
Movement (Resources::ItemVisual *item) | |
virtual uint32 | getType () const =0 |
virtual void | start () |
virtual void | stop (bool force=false) |
virtual void | onGameLoop ()=0 |
bool | hasEnded () const |
virtual bool | hasReachedDestination () const |
virtual void | saveLoad (ResourceSerializer *serializer)=0 |
Static Public Member Functions | |
static Movement * | construct (uint32 type, Resources::ItemVisual *item) |
Protected Types | |
enum | TurnDirection { kTurnNone, kTurnLeft, kTurnRight } |
Protected Member Functions | |
float | computeAngleBetweenVectorsXYPlane (const Math::Vector3d &v1, const Math::Vector3d &v2) const |
Protected Attributes | |
const float | _defaultTurnAngleSpeed |
bool | _ended |
Resources::ItemVisual * | _item |
Abstract movement of an item on the current location's floor
|
static |
Movement factory
|
pure virtual |
Obtain the effective movement type
Implemented in Stark::Walk, Stark::FollowPath, Stark::FollowPathLight, and Stark::Turn.
|
virtual |
Initiate the movement
Reimplemented in Stark::Walk, Stark::FollowPath, and Stark::FollowPathLight.
|
virtual |
Stop / abort the movement
Reimplemented in Stark::Walk, Stark::FollowPath, and Stark::FollowPathLight.
|
pure virtual |
Called once per game loop
Implemented in Stark::Walk, Stark::FollowPath, Stark::FollowPathLight, and Stark::Turn.
bool Stark::Movement::hasEnded | ( | ) | const |
Has the movement stopped?
|
virtual |
Has the movement reached its destination successfully?
Reimplemented in Stark::Walk.
|
pure virtual |
Persist / restore the state of the movement so it can be resumed using 'start'
Implemented in Stark::Walk, Stark::FollowPath, Stark::FollowPathLight, and Stark::Turn.