Space Engineers
Public Member Functions | Protected Member Functions | Properties | Events | List of all members
VRage.Generics.MySingleStateMachine Class Reference

Implementation of generic state machine. Inherit from this class to create your own state machine. Transitions are performed automatically on each update (if conditions of transition are fulfilled). More...

Inheritance diagram for VRage.Generics.MySingleStateMachine:
VRage.Generics.MyStateMachine VRage.Game.VisualScripting.Campaign.MyCampaignStateMachine VRageRender.Animations.MyAnimationStateMachine

Public Member Functions

delegate void StateChangedHandler (MyStateMachineTransitionWithStart transition)
 
override bool DeleteCursor (int id)
 
override MyStateMachineCursor CreateCursor (string nodeName)
 Creates new active cursor. More...
 
bool SetState (string nameOfNewState)
 
- Public Member Functions inherited from VRage.Generics.MyStateMachine
MyStateMachineCursor FindCursor (int cursorId)
 
virtual bool AddNode (MyStateMachineNode newNode)
 
MyStateMachineNode FindNode (string nodeName)
 
virtual bool DeleteNode (string nodeName)
 
virtual MyStateMachineTransition AddTransition (string startNodeName, string endNodeName, MyStateMachineTransition existingInstance=null, string name=null)
 
MyStateMachineTransition FindTransition (int transitionId)
 
MyStateMachineTransitionWithStart FindTransitionWithStart (int transitionId)
 
virtual bool DeleteTransition (int transitionId)
 
virtual bool SetState (int cursorId, string nameOfNewState)
 Set the current state. Warning - this is not a thing that you would like to normally do, state machine should live its own life (based on transition condition). Returns true on success. More...
 
virtual void Update ()
 Update the state machine. Transition to new states. More...
 
void TriggerAction (MyStringId actionName)
 Trigger an action in this layer. If there is a transition having given (non-null) name, it is followed immediatelly. Conditions of transition are ignored. More...
 
void SortTransitions ()
 Sort the transitions between states according to their priorities. More...
 
delegate void StateChangedHandler (MyStateMachineTransitionWithStart transition)
 
 MyStateMachine ()
 
bool AddNode (MyStateMachineNode newNode)
 
MyStateMachineNode FindNode (string nodeName)
 
bool DeleteNode (string nodeName)
 
MyStateMachineTransition AddTransition (string startNodeName, string endNodeName, MyStateMachineTransition existingInstance=null)
 
MyStateMachineTransition FindTransition (int transitionId)
 
bool DeleteTransition (int transitionId)
 
void Update ()
 
void TriggerAction (MyStringId actionName)
 Trigger an action in this layer. If there is a transition having given (non-null) name, it is followed immediatelly. Conditions of transition are ignored. More...
 
void SortTransitions ()
 Sort the transitions between states according to their priorities. More...
 

Protected Member Functions

void NotifyStateChanged (MyStateMachineTransitionWithStart transitionWithStart)
 
- Protected Member Functions inherited from VRage.Generics.MyStateMachine
void NotifyStateChanged (MyStateMachineTransitionWithStart transitionWithStart)
 

Properties

MyStateMachineNode CurrentNode [get]
 
- Properties inherited from VRage.Generics.MyStateMachine
DictionaryReader< string, MyStateMachineNodeAllNodes [get]
 
List< MyStateMachineCursorActiveCursors [get]
 
string Name [get, set]
 
MyStateMachineNode CurrentNode [get, protected set]
 

Events

StateChangedHandler OnStateChanged
 
- Events inherited from VRage.Generics.MyStateMachine
StateChangedHandler OnStateChanged
 

Additional Inherited Members

- Protected Attributes inherited from VRage.Generics.MyStateMachine
Dictionary< string, MyStateMachineNodem_nodes = new Dictionary<string, MyStateMachineNode>()
 
Dictionary< int, MyStateMachineTransitionWithStartm_transitions = new Dictionary<int, MyStateMachineTransitionWithStart>()
 
Dictionary< int, MyStateMachineCursorm_activeCursorsById = new Dictionary<int, MyStateMachineCursor>()
 
CachingList< MyStateMachineCursorm_activeCursors = new CachingList<MyStateMachineCursor>()
 
MyConcurrentHashSet< MyStringIdm_enqueuedActions = new MyConcurrentHashSet<MyStringId>()
 

Detailed Description

Implementation of generic state machine. Inherit from this class to create your own state machine. Transitions are performed automatically on each update (if conditions of transition are fulfilled).

Definition at line 7 of file MySingleStateMachine.cs.

Member Function Documentation

override MyStateMachineCursor VRage.Generics.MySingleStateMachine.CreateCursor ( string  nodeName)
inlinevirtual

Creates new active cursor.

Reimplemented from VRage.Generics.MyStateMachine.

Definition at line 25 of file MySingleStateMachine.cs.

override bool VRage.Generics.MySingleStateMachine.DeleteCursor ( int  id)
inlinevirtual

Reimplemented from VRage.Generics.MyStateMachine.

Definition at line 20 of file MySingleStateMachine.cs.

void VRage.Generics.MySingleStateMachine.NotifyStateChanged ( MyStateMachineTransitionWithStart  transitionWithStart)
inlineprotected

Definition at line 12 of file MySingleStateMachine.cs.

bool VRage.Generics.MySingleStateMachine.SetState ( string  nameOfNewState)
inlinevirtual

Reimplemented from VRage.Generics.MyStateMachine.

Definition at line 45 of file MySingleStateMachine.cs.

delegate void VRage.Generics.MySingleStateMachine.StateChangedHandler ( MyStateMachineTransitionWithStart  transition)

Property Documentation

MyStateMachineNode VRage.Generics.MySingleStateMachine.CurrentNode
get

Definition at line 33 of file MySingleStateMachine.cs.

Event Documentation

StateChangedHandler VRage.Generics.MySingleStateMachine.OnStateChanged

Definition at line 11 of file MySingleStateMachine.cs.


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