new tart.StateMachine()
Tart State Machine Class
Extends
- goog.pubsub.PubSub
Members
-
createStates
-
This should be overridden by child classes. It holds the initialization of states and is called when the
startMachine
method is called for the first time.
Methods
-
protectedaddState(state)
-
Adds a state to the state machine.
Name Type Description state
tart.State State to be added.
-
protectedsetCurrentState(state, opt_args)
-
Sets the current state disregarding the previous one, and executes it's function.
Name Type Description state
tart.State State to be set as the current state.
opt_args
Array.<*> optional Arguments to pass to the new state.
-
startMachine()
-
Starts the state machine. If it's the first time this function is called, it also lazy loads the states via
createStates
method.