ScummVM API documentation
Stark::Movement Class Referenceabstract

#include <movement.h>

Inheritance diagram for Stark::Movement:
Stark::FollowPath Stark::FollowPathLight Stark::Turn Stark::Walk

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 Movementconstruct (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
 

Detailed Description

Abstract movement of an item on the current location's floor

Member Function Documentation

◆ construct()

static Movement* Stark::Movement::construct ( uint32  type,
Resources::ItemVisual item 
)
static

Movement factory

◆ getType()

virtual uint32 Stark::Movement::getType ( ) const
pure virtual

Obtain the effective movement type

Implemented in Stark::Walk, Stark::FollowPath, Stark::FollowPathLight, and Stark::Turn.

◆ start()

virtual void Stark::Movement::start ( )
virtual

Initiate the movement

Reimplemented in Stark::Walk, Stark::FollowPath, and Stark::FollowPathLight.

◆ stop()

virtual void Stark::Movement::stop ( bool  force = false)
virtual

Stop / abort the movement

Reimplemented in Stark::Walk, Stark::FollowPath, and Stark::FollowPathLight.

◆ onGameLoop()

virtual void Stark::Movement::onGameLoop ( )
pure virtual

Called once per game loop

Implemented in Stark::Walk, Stark::FollowPath, Stark::FollowPathLight, and Stark::Turn.

◆ hasEnded()

bool Stark::Movement::hasEnded ( ) const

Has the movement stopped?

◆ hasReachedDestination()

virtual bool Stark::Movement::hasReachedDestination ( ) const
virtual

Has the movement reached its destination successfully?

Reimplemented in Stark::Walk.

◆ saveLoad()

virtual void Stark::Movement::saveLoad ( ResourceSerializer serializer)
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.


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