Package | com.eqsim.FStEng |
Class | public class StateManager |
Inheritance | StateManager ![]() |
The State (network) Manager class is used at run-time to manage which state(s) are active and which have been visited last (the history mechanism), in each network (collection of states). All HState's must have only one State Manager, and all HStateC's must have one or more State Managers that you create.
Property | Defined By | ||
---|---|---|---|
contSt : HStateC
Pointer to state containing this manager. | StateManager | ||
cs : String
Identifier of the current state. | StateManager | ||
defSt : String
Identifier for the default start state. | StateManager | ||
id : String
State Manager's identifier that must be different from other StateManager's in sibling networks. | StateManager | ||
name : String
An optional name to give to the State Manager, used for display purposes only. | StateManager |
Method | Defined By | ||
---|---|---|---|
StateManager(identifier:String, containerState:HStateC, defaultState:String = null, n:String = null)
Constructor for State (network) Manager. | StateManager | ||
Adds a hierarchical state (HState) to the network that this manager manages. | StateManager | ||
addHStateC(id:String, nm:String = null):HStateC
Adds a concurrent, hierarchical state (HStateC) to the network that this manager manages. | StateManager | ||
Adds a simple state (State) to the network that this manager manages. | StateManager | ||
chgSt(trans:Transition, val:*):void
Changes the current state (managed by this manager) based on the given transition ID. | StateManager |
contSt | property |
public var contSt:HStateC
Pointer to state containing this manager.
Indicates which state encloses this network, in other words, which state is this manager working for. Set to 'null' if this is manager at state engine (top) level.
cs | property |
public var cs:String
Identifier of the current state.
If this manager's network is active, this value is the current state's identifier.
defSt | property |
public var defSt:String
Identifier for the default start state.
State machine developers indicate which state should be the default start state. By convention, state identifiers are numeric, but we have implemented them as String's to give more flexibility.
id | property |
public var id:String
State Manager's identifier that must be different from other StateManager's in sibling networks. By convention, the identifier is alphabetic. The identifier uniqueness only really becomes important in HStateC's, since that is the only state class with sibling networks.
name | property |
public var name:String
An optional name to give to the State Manager, used for display purposes only. If no name is set, we use id by default.
StateManager | () | Constructor |
public function StateManager(identifier:String, containerState:HStateC, defaultState:String = null, n:String = null)
Constructor for State (network) Manager. One StateManager is required to manage the network of each HState, or each sub-network of an HStateC.
Parametersidentifier:String — String identifier (id) for the state manager. Identifier must be unique only for sibling managers in an HStateC.
| |
containerState:HStateC — Pointer to state containing this manager. 'null' if this is manager at state engine (top) level.
| |
defaultState:String (default = null ) — Default start state (use the State's id). It is optional here, but if not given here, the developer must specify one with setDefaultState() .
| |
n:String (default = null ) — State manager name (optional). Used for display purposes only. If no name passed in, routines use id.
|
addHState | () | method |
public function addHState(id:String, nm:String = null):HState
Adds a hierarchical state (HState) to the network that this manager manages. Developers can call this routine or create a State using 'new'.
Parameters
id:String — Unique identifier for this state, unique across all states.
| |
nm:String (default = null ) — Optional display name for the state. If not supplied, engine use id.
|
HState —
|
addHStateC | () | method |
public function addHStateC(id:String, nm:String = null):HStateC
Adds a concurrent, hierarchical state (HStateC) to the network that this manager manages. Developers can call this routine or create a State using 'new'.
Parameters
id:String — Unique identifier for this state, unique across all states.
| |
nm:String (default = null ) — Optional display name for the state. If not supplied, engine use id.
|
HStateC —
|
addState | () | method |
public function addState(id:String, nm:String = null):State
Adds a simple state (State) to the network that this manager manages. Developers can call this routine or create a State using 'new'.
Parameters
id:String — Unique identifier for this state, unique across all states.
| |
nm:String (default = null ) — Optional display name for the state. If not supplied, engine use id.
|
State —
|
chgSt | () | method |
public function chgSt(trans:Transition, val:*):void
Changes the current state (managed by this manager) based on the given transition ID.
In most circumstances, the engine handles triggering transitions based on injected events. In some rare situations,
developers may want to trigger a transition manually. There is a method of State called chgSt()
, which
triggers the transition specified by the given transition identifier. Similarly, the StateManager chgSt() can be used
to trigger a transition (identifier of the current state).
Parameters
trans:Transition — Transition ID to use for current state
| |
val:* — an optional argument that is passed to the transition function
|