Dart Documentationsystem_entity_stateEntityStateComponent

EntityStateComponent class

A component containing information about EntityState to used for the component.

Based on http://www.richardlord.net/blog/finite-state-machines-with-ash

class EntityStateComponent extends Component {
 int _currentState = null;
 int _previousState = null;
 Map<int, EntityState> _states;

 /// the name of the 'virtual' state (if != currentState, then it be after next
 /// [EntityStateSystem.process()]
 int state;

 /// the name of the current state.
 get currentState => _currentState;
 /// the name of the previous state (before last [EntityStateSystem.process()])
 get previousState => _previousState;


 EntityStateComponent(this.state, Map<int, EntityState> this._states);
}

Extends

Component > EntityStateComponent

Constructors

new EntityStateComponent(int state, Map<int, EntityState> _states) #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
EntityStateComponent(this.state, Map<int, EntityState> this._states);

Properties

final currentState #

the name of the current state.

get currentState => _currentState;

final previousState #

the name of the previous state (before last EntityStateSystem.process())

get previousState => _previousState;

int state #

the name of the 'virtual' state (if != currentState, then it be after next EntityStateSystem.process()

int state