Atoms Crowd  7.0.0
Atoms::StateMachine Class Reference

State machine. More...

#include <StateMachine.h>

Public Member Functions

 StateMachine ()
 Constructor.
 
 StateMachine (const std::string &name)
 Constructor. More...
 
 StateMachine (const StateMachine &other)
 Copy constructor.
 
StateMachineoperator= (const StateMachine &other)
 Assign operator.
 
 ~StateMachine ()
 Destructor.
 
void addAnimationState (const AnimationState &state)
 Adds animation state. More...
 
AnimationStateanimationState (const std::string &name)
 Gets animation state. More...
 
AnimationStateanimationStateFromId (const int id)
 Gets animation state from id. More...
 
const std::vector< AnimationState > & animationStates () const
 Gets animation states. More...
 
void connect (const std::string &fromState, const std::string &toState, AnimationState &transition)
 Connects two states.
 
void breakConnection (const std::string &fromState, const std::string &toState)
 Disconnects two states.
 
const std::map< std::pair< int, int >, AnimationState > & connections () const
 Gets of all connections.
 
void getConnectedStates (std::vector< int > &connectedStates, const AnimationState &state) const
 Gets all states connected to this state.
 
void setName (const std::string &name)
 Sets the name. More...
 
const std::string & name () const
 Gets the name. More...
 
std::vector< int > getShortestPathBetweenStates (const int startStateId, const int endStateid)
 Get shortest path between two states.
 

Detailed Description

State machine.

A state machine defines the relationships between animation states. It's used by the engine to work out the transition between animation clips.

Constructor & Destructor Documentation

◆ StateMachine()

Atoms::StateMachine::StateMachine ( const std::string &  name)

Constructor.

Parameters
nameState machine name

Member Function Documentation

◆ addAnimationState()

void Atoms::StateMachine::addAnimationState ( const AnimationState state)
inline

Adds animation state.

Adds an animations tate tot he state machine

Parameters
stateAnimation state

◆ animationState()

AnimationState& Atoms::StateMachine::animationState ( const std::string &  name)

Gets animation state.

Gets an animation state

Returns
animation state

◆ animationStateFromId()

AnimationState& Atoms::StateMachine::animationStateFromId ( const int  id)

Gets animation state from id.

Gets an animation state from id

Returns
animation state

◆ animationStates()

const std::vector< AnimationState > & Atoms::StateMachine::animationStates ( ) const
inline

Gets animation states.

Gets a vector with the animation states saved inside the state machine

Returns
Vector of animation states

◆ name()

const std::string & Atoms::StateMachine::name ( ) const
inline

Gets the name.

Returns
name State machine name

◆ setName()

void Atoms::StateMachine::setName ( const std::string &  name)
inline

Sets the name.

Parameters
nameState machine name

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