Package | com.eqsim.FStEng |
Class | public class HState |
Inheritance | HState ![]() ![]() ![]() |
Method | Defined By | ||
---|---|---|---|
HState(identifier:*, msm:StateManager = null, nm:String = null)
Create a new hierarchical state with a single sub-network. | HState | ||
![]() | addPulseActivity(intvl:uint, cb:Function, fb:Boolean = false):PulseActivity
Use this method to add an activity to the state that fires at a specified interval. | State | |
![]() | addStateManager(sm:StateManager):void
Adds the specified state manager (StateManager) to this state. | HStateC | |
![]() |
Given an identifier, create a new sub-state that is a hierarchical state (HState). | HStateC | |
![]() |
Given an identifier, create a new sub-state that is a concurrent, hierarchical state (HStateC). | HStateC | |
![]() |
Given an identifier, create a new sub-state that is a simple state (State). | HStateC | |
![]() | addTransitionExternal(tEvtName:String, targetStateID:String, transFn:Function = null, ulfxt:uint = 1):Transition
Add an 'external' transition, i.e., from this State to a target state. | State | |
![]() | addTransitionToHistory(tEvtName:String, targetStateID:String, transFn:Function = null):Transition
Add a transition from the current state to the history pseudo-state of a state. | State | |
![]() | addTransitionToSelf(tEvtName:String, transFn:Function = null, ulfst:int = 0):Transition
Add a transition from this State to itself, specifying parents to exit and re-enter. | State | |
![]() | addTransitionToTarget(tEvtName:String, targetStateID:String, transFn:Function = null):Transition
Add a transition from this State to a target state other than history. | State | |
![]() | chgSt(trans:Transition, val:* = null):void
Change state using transition trans_i, with an optional value for the
transition function as a second argument. | State | |
![]() | enter(hist:Boolean = false, specIDs:Array = null):void
Called when a state is entered. | State | |
![]() | isActive():Boolean
convenience function. | State | |
![]() | isSubstate(st:State):Boolean [override]
isSubstate allows the caller to ask if a state is a substate of the state being called. | HStateC | |
![]() | leave():void
Called when the state is exited (deactivated). | State | |
![]() | onEvent(ev:Event, handledYet:Boolean):Boolean
This is a new feature of FStEng v1.5, which provides an easy way to direct and process
events. | State | |
![]() | registerSubStates(stateEng:StateEngine):void
Goes through substates to register them with the state engine. | State | |
![]() | removePulseActivity(pa:PulseActivity):void
Removes the specified pulse activity from the state. | State | |
![]() | removeState():void [override]
Deletes memory associated with this state. | HStateC | |
![]() | removeTransition(trans:Transition):void
Remove the given transition from this State. | State | |
![]() | resetHistory():void | State | |
setDefaultStartState(sid:String, mgr:StateManager = null):void [override]
Allows the developer to specify the default start state. | HState |
HState | () | Constructor |
public function HState(identifier:*, msm:StateManager = null, nm:String = null)
Create a new hierarchical state with a single sub-network.
You must assign the HState a unique identifier with respect to its sibling states, i.e., the states in the same network as this HState. Identifiers for states are, by convention, numeric, though the implementation uses Strings for identifiers (since numeric comparison is never required).
When you create an HState, you must also create a state manager (StateManager). When you create a StateManager, you specify the hierarchical state which it manages.
Parametersidentifier:* — State identifier (id). Must be unique among all states in the state engine.
| |
msm:StateManager (default = null ) — Pointer to the StateManager in the network that this HStateC belongs. Pass in the parent
state, not the StateManager that will control this state's sub-network.
| |
nm:String (default = null ) — Display name of the State. If null (not supplied), routines use the id for the display name.
|
setDefaultStartState | () | method |
override public function setDefaultStartState(sid:String, mgr:StateManager = null):void
Allows the developer to specify the default start state.
The default start state is specified in the State Manager, but for HState's, there is only one manager, so we can go ahead (if the manager is set) to adjust the default start state.
Parameters
sid:String — String identifier for the state
| |
mgr:StateManager (default = null ) — Optional parameter specifying the manager for the HState's sub-network (who is the manager for the state you're making default start). This is declared for consistency with HStateC, though it always will be null for HState's (since we can determine it automatically)
|