-
addState(state) → {jsfsa.Automaton}
-
Adds a state to the Automaton
Parameters:
Name |
Type |
Description |
state |
jsfsa.State
|
|
- Source:
Returns:
the instance of jsfsa.Automaton that is acted upon
-
Type
-
jsfsa.Automaton
-
createState(stateName, stateData) → {jsfsa.Automaton}
-
Creates a state and adds it to the Automaton
Parameters:
Name |
Type |
Description |
stateName |
String
|
|
stateData |
Object
|
|
- Source:
Returns:
the instance of jsfsa.Automaton that is acted upon
-
Type
-
jsfsa.Automaton
-
destroy()
-
Destroys all internal states and prepares the Automaton to be dismantled by
-- the horrible GARBAGE COLLECTOR --
Sorry, couldn't resist.
- Source:
-
doTransition(transitionName) → {jsfsa.Automaton}
-
Starts transitioning from the current state to the state as defined by the transition
Accepts any number of arguments after transitionName
that will be passed on to the
guards and actions
Parameters:
Name |
Type |
Description |
transitionName |
String
|
|
- Source:
Returns:
the instance of jsfsa.Automaton that is acted upon
-
Type
-
jsfsa.Automaton
-
getCurrentBranch() → {jsfsa.State[]}
-
Returns a top-down list of the currently active hierarchical states
- Source:
Returns:
-
Type
-
jsfsa.State[]
-
getCurrentState() → {jsfsa.State}
-
Returns the lowest state that is currently active
- Source:
Returns:
-
Type
-
jsfsa.State
-
getState(stateName) → {jsfsa.State}
-
Retrieves a state
Parameters:
Name |
Type |
Description |
stateName |
String
|
|
- Source:
Returns:
undefined
if no state with name stateName
was found.
-
Type
-
jsfsa.State
-
hasState(stateName) → {Boolean}
-
Checks whether the a state with name stateName
was added to the Automaton
Parameters:
Name |
Type |
Description |
stateName |
String
|
|
- Source:
Returns:
-
Type
-
Boolean
-
isInCurrentBranch(stateName) → {Boolean}
-
Checks whether a state with name statename
is currently active
Parameters:
Name |
Type |
Description |
stateName |
|
|
- Source:
Returns:
-
Type
-
Boolean
-
isTransitioning() → {Boolean}
-
Returns whether the Automaton is currently transitioning from one state to the other
- Source:
Returns:
-
Type
-
Boolean
-
parse(data) → {jsfsa.Automaton}
-
Parses a JSON formatted data object and translates it to states and transitions
Parameters:
Name |
Type |
Description |
data |
Object
|
JSON formatted data object |
- Source:
Returns:
the instance of jsfsa.Automaton that is acted upon
-
Type
-
jsfsa.Automaton
-
pause() → {jsfsa.Automaton}
-
Pauses the transitioning between states
- Source:
Returns:
the instance of jsfsa.Automaton that is acted upon
-
Type
-
jsfsa.Automaton
-
proceed() → {jsfsa.Automaton}
-
Resumes the transitioning between states
- Source:
Returns:
the instance of jsfsa.Automaton that is acted upon
-
Type
-
jsfsa.Automaton
-
removeState(stateName) → {jsfsa.Automaton}
-
Removes the state with name stateName
from the Automaton
Parameters:
Name |
Type |
Description |
stateName |
String
|
|
- Source:
Returns:
the instance of jsfsa.Automaton that is acted upon
-
Type
-
jsfsa.Automaton