Finite State Machine Helper  1.0
Public Member Functions | List of all members
FSMHelper.FSMStateMachineLogic Class Reference

This is a wrapper class to contain internal data for a state like its children, parent, etc It hides the internals from the gameplay code. The user should not have to interact with this class directly. More...

Public Member Functions

 FSMStateMachineLogic (FSMStateType stateType, List< System.Type > childrenTypes, FSMStateMachine ownerSM, FSMStateMachineLogic parent)
 
 FSMStateMachineLogic (System.Type stateClass, FSMStateMachine ownerSM, FSMStateMachineLogic parent)
 
string GetActiveStateTreeText (int level)
 Recursive function to get the hierarchy of current active states More...
 
BaseFSMState GetParentState ()
 Accessor to get the parent state. More...
 
FSMStateMachine GetStateMachine ()
 Accessor to get the state machine object More...
 
void Enter (object[] args)
 Enters the specified state. It will also enter all necessary children state. More...
 
void Exit ()
 Exits the specified state. All children states will be exited before calling exit on m_State More...
 
void Update ()
 Update logic for the state. Note that child state updates will be called before the m_State's update. More...
 
bool RequestChildTransition (FSMStateMachineLogic child, System.Type nextState, object[] args)
 Try to make one of my children transition to the specified state More...
 
bool DoTransition (System.Type nextState, object[] args)
 Intermediary function to request the parent state to transition myself to nextState More...
 
void BroadcastMessage (object[] args)
 Intermediary function to notify the state machine to broadcast the message to all states recursively More...
 
void ReceiveMessage (object[] args)
 Intermediary function to recursively pass the message to all children More...
 
bool IsInState (System.Type state)
 Helper function to know if a state is currently active in the statemachine. More...
 

Detailed Description

This is a wrapper class to contain internal data for a state like its children, parent, etc It hides the internals from the gameplay code. The user should not have to interact with this class directly.

Member Function Documentation

void FSMHelper.FSMStateMachineLogic.BroadcastMessage ( object[]  args)

Intermediary function to notify the state machine to broadcast the message to all states recursively

Parameters
argsThe arguments of the message
bool FSMHelper.FSMStateMachineLogic.DoTransition ( System.Type  nextState,
object[]  args 
)

Intermediary function to request the parent state to transition myself to nextState

Parameters
nextStateThe class type of the next state to transition to.
argsThe arguments of the transition.
void FSMHelper.FSMStateMachineLogic.Enter ( object[]  args)

Enters the specified state. It will also enter all necessary children state.

Parameters
argsThe arguments passed in the transition. The state's constructor will be chosen to match the arguments specified. If args is null, the default constructor will be used.
void FSMHelper.FSMStateMachineLogic.Exit ( )

Exits the specified state. All children states will be exited before calling exit on m_State

string FSMHelper.FSMStateMachineLogic.GetActiveStateTreeText ( int  level)

Recursive function to get the hierarchy of current active states

Returns
Returns the text string containing the hierarchy of active states
BaseFSMState FSMHelper.FSMStateMachineLogic.GetParentState ( )

Accessor to get the parent state.

Returns
Returns the parent state. This can be null if it is in the root of the statemachine.
FSMStateMachine FSMHelper.FSMStateMachineLogic.GetStateMachine ( )

Accessor to get the state machine object

Returns
Returns the state machine.
bool FSMHelper.FSMStateMachineLogic.IsInState ( System.Type  state)

Helper function to know if a state is currently active in the statemachine.

Parameters
stateMachineDefinitionThe class type of the state to check
Returns
Returns true if the state is active.
void FSMHelper.FSMStateMachineLogic.ReceiveMessage ( object[]  args)

Intermediary function to recursively pass the message to all children

Parameters
argsThe arguments of the message
bool FSMHelper.FSMStateMachineLogic.RequestChildTransition ( FSMStateMachineLogic  child,
System.Type  nextState,
object[]  args 
)

Try to make one of my children transition to the specified state

Parameters
childThe state that will be transitioned
nextStateThe state you need to transition to. This should a sibling of child.
argsThe arguments passed in the transition.
void FSMHelper.FSMStateMachineLogic.Update ( )

Update logic for the state. Note that child state updates will be called before the m_State's update.


The documentation for this class was generated from the following file: