BGC Tools
Public Member Functions | Properties | Private Member Functions | Private Attributes
BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum > Class Template Reference

Implements a state machine that can be constructed programatically that is similar to the Unity animation state machine but not frame capped. More...

Inheritance diagram for BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >:
Inheritance graph
[legend]
Collaboration diagram for BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >:
Collaboration graph
[legend]

Public Member Functions

 StateMachine (bool verbose=false)
 Construct a StateMachine. Verbose dumps state transition information to UnityEngine.Log More...
 
void AddState (State state)
 Add a state to the state machine More...
 
void AddState (TriggeringState< TTriggerEnum > state)
 
void AddState (CoordinatingState< TBoolEnum, TTriggerEnum > state)
 Add a coordinating state to the state machine More...
 
void AddEntryState (State state)
 Add a state to the StateMachine and sets it as the initial State More...
 
void AddEntryState (CoordinatingState< TBoolEnum, TTriggerEnum > state)
 Add a coordinate state to the state machine that is the initial state More...
 
void AddTransition (State fromState, State targetState, params TransitionCondition< TBoolEnum, TTriggerEnum >[] conditions)
 Add a Standard Transition between two States More...
 
void AddAnyStateTransition (State targetState, params TransitionCondition< TBoolEnum, TTriggerEnum >[] conditions)
 Add a Transition that can occur from any state More...
 
void AddBool (TBoolEnum key, bool initialValue)
 Add a boolean that can affect transitions More...
 
void ActivateTriggerImmediate (TTriggerEnum key)
 Activate a trigger to move the state machine forward. Initiate a transition check if transitions aren't blocked. More...
 
void ActivateTriggerDeferred (TTriggerEnum key)
 Activate a trigger to move the state machine forward. Relies upon the eventual calling of either an Update or an Immediate call. More...
 
void SetBoolImmediate (TBoolEnum key, bool value)
 Set a boolean that can affect transitions. Initiate a transition check if transitions aren't blocked. More...
 
void SetBoolDeferred (TBoolEnum key, bool value)
 Set a boolean that can affect transitions. Relies upon the eventual calling of either an Update or an Immediate call. More...
 
void Update ()
 Call update function on the currently active state. More...
 
void Start ()
 Run the first state of the state machine More...
 
void Reset (bool restartStateMachine=false)
 Reset the state machine by exiting the current state and setting the state to the entry state. If restartStateMachine is set to true then entry state will be entered and the StateMachine will have effectively restarted More...
 
TriggerCondition< TBoolEnum, TTriggerEnum > CreateTriggerCondition (TTriggerEnum key)
 
BoolCondition< TBoolEnum, TTriggerEnum > CreateBoolCondition (TBoolEnum key, bool value)
 
OrConjunction< TBoolEnum, TTriggerEnum > CreateOrConjunction (params TransitionCondition< TBoolEnum, TTriggerEnum >[] conditions)
 

Properties

State CurrentState [get, private set]
 Get the name of the current State that the StateMachine is in More...
 

Private Member Functions

Transition< TBoolEnum, TTriggerEnum > CheckTransitions ()
 Test to see if there is a valid transitions and return it, or null. Clears the dirtyTransitionState flag. More...
 
void ExecuteTransitions ()
 Run transitions as long as we have a valid one to perform next. Blocks immediate transitions from occuring. More...
 
void IStateTrigger< TTriggerEnum >. ActivateTrigger (TTriggerEnum key)
 
bool IStateTrigger< TTriggerEnum >. GetTrigger (TTriggerEnum key)
 
void IStateDataBool< TBoolEnum >. SetBool (TBoolEnum key, bool value)
 
bool IStateDataBool< TBoolEnum >. GetBool (TBoolEnum key)
 
bool ITransitionDataRetriever< TBoolEnum, TTriggerEnum >. GetBool (TBoolEnum key)
 
bool ITransitionDataRetriever< TBoolEnum, TTriggerEnum >. GetTrigger (TTriggerEnum key)
 
void ITransitionDataRetriever< TBoolEnum, TTriggerEnum >. ConsumeTrigger (TTriggerEnum key)
 
void Log (string str)
 Log the string if verbose More...
 

Private Attributes

readonly Dictionary< State, List< Transition< TBoolEnum, TTriggerEnum > > > stateTransitions
 
readonly List< Transition< TBoolEnum, TTriggerEnum > > anyStateTransitions
 
readonly StateData< TBoolEnum, TTriggerEnum > stateData
 
readonly bool verbose
 
State entryState = null
 
bool running = false
 
bool dirtyTransitionState = false
 
bool blockTransitions = false
 

Detailed Description

Implements a state machine that can be constructed programatically that is similar to the Unity animation state machine but not frame capped.

To use the update function, put the Update call in a MonoBehavior class Update call.

Type Constraints
TBoolEnum :Enum 
TTriggerEnum :Enum 

Definition at line 14 of file StateMachine.cs.

Constructor & Destructor Documentation

◆ StateMachine()

BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.StateMachine ( bool  verbose = false)
inline

Construct a StateMachine. Verbose dumps state transition information to UnityEngine.Log

Definition at line 42 of file StateMachine.cs.

43  {
44  this.verbose = verbose;
45  stateData = new StateData<TBoolEnum, TTriggerEnum>();
46  stateTransitions = new Dictionary<State, List<Transition<TBoolEnum, TTriggerEnum>>>();
47  anyStateTransitions = new List<Transition<TBoolEnum, TTriggerEnum>>();
48  }
readonly List< Transition< TBoolEnum, TTriggerEnum > > anyStateTransitions
Definition: StateMachine.cs:22
readonly Dictionary< State, List< Transition< TBoolEnum, TTriggerEnum > > > stateTransitions
Definition: StateMachine.cs:21
readonly StateData< TBoolEnum, TTriggerEnum > stateData
Definition: StateMachine.cs:23

Member Function Documentation

◆ ActivateTrigger()

void IStateTrigger<TTriggerEnum>. BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.ActivateTrigger ( TTriggerEnum  key)
private

◆ ActivateTriggerDeferred()

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.ActivateTriggerDeferred ( TTriggerEnum  key)
inline

Activate a trigger to move the state machine forward. Relies upon the eventual calling of either an Update or an Immediate call.

Definition at line 186 of file StateMachine.cs.

187  {
188  Debug.Assert(running,
189  "Activating Triggers when the StateMachine is not running will accomplish nothing");
190 
191  stateData.ActivateTrigger(key);
192  dirtyTransitionState = true;
193  }
readonly StateData< TBoolEnum, TTriggerEnum > stateData
Definition: StateMachine.cs:23

◆ ActivateTriggerImmediate()

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.ActivateTriggerImmediate ( TTriggerEnum  key)
inline

Activate a trigger to move the state machine forward. Initiate a transition check if transitions aren't blocked.

Definition at line 165 of file StateMachine.cs.

166  {
167  Debug.Assert(running,
168  "Activating Triggers when the StateMachine is not running will accomplish nothing");
169 
170  stateData.ActivateTrigger(key);
171 
172  if (!blockTransitions)
173  {
175  }
176  else
177  {
178  dirtyTransitionState = true;
179  }
180  }
void ExecuteTransitions()
Run transitions as long as we have a valid one to perform next. Blocks immediate transitions from occ...
readonly StateData< TBoolEnum, TTriggerEnum > stateData
Definition: StateMachine.cs:23

◆ AddAnyStateTransition()

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.AddAnyStateTransition ( State  targetState,
params TransitionCondition< TBoolEnum, TTriggerEnum > []  conditions 
)
inline

Add a Transition that can occur from any state

Definition at line 145 of file StateMachine.cs.

References BGC.StateMachine.Transition< TBoolEnum, TTriggerEnum >.SetStateDataRetrievers().

148  {
149  Transition<TBoolEnum, TTriggerEnum> transition = new Transition<TBoolEnum, TTriggerEnum>(targetState, conditions);
150  transition.SetStateDataRetrievers(this);
151  anyStateTransitions.Add(transition);
152  }
readonly List< Transition< TBoolEnum, TTriggerEnum > > anyStateTransitions
Definition: StateMachine.cs:22
Here is the call graph for this function:

◆ AddBool()

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.AddBool ( TBoolEnum  key,
bool  initialValue 
)

Add a boolean that can affect transitions

◆ AddEntryState() [1/2]

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.AddEntryState ( State  state)
inline

Add a state to the StateMachine and sets it as the initial State

Definition at line 91 of file StateMachine.cs.

92  {
93  if (entryState != null)
94  {
95  throw new ArgumentException(
96  message: $"{state.Name} cannot be made the entry state because " +
97  $"{entryState} was already defined as the entry state.",
98  paramName: nameof(entryState));
99  }
100 
101  AddState(state);
102  entryState = state;
103  }
void AddState(State state)
Add a state to the state machine
Definition: StateMachine.cs:53

◆ AddEntryState() [2/2]

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.AddEntryState ( CoordinatingState< TBoolEnum, TTriggerEnum >  state)
inline

Add a coordinate state to the state machine that is the initial state

Parameters
state

Definition at line 109 of file StateMachine.cs.

110  {
111  if (entryState != null)
112  {
113  throw new ArgumentException(
114  message: $"{state.Name} cannot be made the entry state because " +
115  $"{entryState} was already defined as the entry state.",
116  paramName: nameof(entryState));
117  }
118 
119  AddState(state);
120  entryState = state;
121  }
void AddState(State state)
Add a state to the state machine
Definition: StateMachine.cs:53

◆ AddState() [1/3]

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.AddState ( State  state)
inline

Add a state to the state machine

Definition at line 53 of file StateMachine.cs.

References BGC.StateMachine.State.SetVerbose().

54  {
55  if (state is CoordinatingState<TBoolEnum, TTriggerEnum> coordinatingState)
56  {
57  AddState(coordinatingState);
58  }
59  else if (state is TriggeringState<TTriggerEnum> triggeringState)
60  {
61  AddState(triggeringState);
62  }
63  else
64  {
65  state.SetVerbose(verbose);
66  stateTransitions.Add(state, new List<Transition<TBoolEnum, TTriggerEnum>>());
67  }
68  }
readonly Dictionary< State, List< Transition< TBoolEnum, TTriggerEnum > > > stateTransitions
Definition: StateMachine.cs:21
void AddState(State state)
Add a state to the state machine
Definition: StateMachine.cs:53
Here is the call graph for this function:

◆ AddState() [2/3]

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.AddState ( TriggeringState< TTriggerEnum >  state)
inline

Definition at line 70 of file StateMachine.cs.

References BGC.StateMachine.TriggeringState< TTriggerEnum >.SetStateMachineFunctions(), and BGC.StateMachine.State.SetVerbose().

71  {
72  state.SetStateMachineFunctions(this);
73  state.SetVerbose(verbose);
74  stateTransitions.Add(state, new List<Transition<TBoolEnum, TTriggerEnum>>());
75  }
readonly Dictionary< State, List< Transition< TBoolEnum, TTriggerEnum > > > stateTransitions
Definition: StateMachine.cs:21
Here is the call graph for this function:

◆ AddState() [3/3]

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.AddState ( CoordinatingState< TBoolEnum, TTriggerEnum >  state)
inline

Add a coordinating state to the state machine

Parameters
state

Definition at line 81 of file StateMachine.cs.

References BGC.StateMachine.CoordinatingState< TBoolEnum, TTriggerEnum >.SetStateMachineFunctions(), and BGC.StateMachine.State.SetVerbose().

82  {
83  state.SetStateMachineFunctions(this, this);
84  state.SetVerbose(verbose);
85  stateTransitions.Add(state, new List<Transition<TBoolEnum, TTriggerEnum>>());
86  }
readonly Dictionary< State, List< Transition< TBoolEnum, TTriggerEnum > > > stateTransitions
Definition: StateMachine.cs:21
Here is the call graph for this function:

◆ AddTransition()

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.AddTransition ( State  fromState,
State  targetState,
params TransitionCondition< TBoolEnum, TTriggerEnum > []  conditions 
)
inline

Add a Standard Transition between two States

Definition at line 126 of file StateMachine.cs.

References BGC.StateMachine.Transition< TBoolEnum, TTriggerEnum >.SetStateDataRetrievers().

130  {
131  if (fromState == null)
132  {
133  throw new ArgumentNullException(nameof(fromState),
134  message: "Cannot add a transition that has an empty state");
135  }
136 
137  Transition<TBoolEnum, TTriggerEnum> transition = new Transition<TBoolEnum, TTriggerEnum>(targetState, conditions);
138  stateTransitions[fromState].Add(transition);
139  transition.SetStateDataRetrievers(this);
140  }
readonly Dictionary< State, List< Transition< TBoolEnum, TTriggerEnum > > > stateTransitions
Definition: StateMachine.cs:21
Here is the call graph for this function:

◆ CheckTransitions()

Transition<TBoolEnum, TTriggerEnum> BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.CheckTransitions ( )
inlineprivate

Test to see if there is a valid transitions and return it, or null. Clears the dirtyTransitionState flag.

Definition at line 319 of file StateMachine.cs.

320  {
321  dirtyTransitionState = false;
322 
323  //Check AnyState Transitions First
324  for (int i = 0; i < anyStateTransitions.Count; ++i)
325  {
326  if (anyStateTransitions[i].ShouldTransition())
327  {
328  return anyStateTransitions[i];
329  }
330  }
331 
332  //Check State Transitions Next
333  for (int i = 0; i < stateTransitions[CurrentState].Count; ++i)
334  {
335  if (stateTransitions[CurrentState][i].ShouldTransition())
336  {
337  return stateTransitions[CurrentState][i];
338  }
339  }
340 
341  //No valid Transition found
342  return null;
343  }
readonly List< Transition< TBoolEnum, TTriggerEnum > > anyStateTransitions
Definition: StateMachine.cs:22
readonly Dictionary< State, List< Transition< TBoolEnum, TTriggerEnum > > > stateTransitions
Definition: StateMachine.cs:21
State CurrentState
Get the name of the current State that the StateMachine is in
Definition: StateMachine.cs:35

◆ ConsumeTrigger()

void ITransitionDataRetriever<TBoolEnum, TTriggerEnum>. BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.ConsumeTrigger ( TTriggerEnum  key)
private

◆ CreateBoolCondition()

BoolCondition<TBoolEnum, TTriggerEnum> BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.CreateBoolCondition ( TBoolEnum  key,
bool  value 
)
inline

Definition at line 389 of file StateMachine.cs.

390  {
391  return new BoolCondition<TBoolEnum, TTriggerEnum>(key, value);
392  }

◆ CreateOrConjunction()

OrConjunction<TBoolEnum, TTriggerEnum> BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.CreateOrConjunction ( params TransitionCondition< TBoolEnum, TTriggerEnum > []  conditions)
inline

Definition at line 394 of file StateMachine.cs.

395  {
396  return new OrConjunction<TBoolEnum, TTriggerEnum>(conditions);
397  }

◆ CreateTriggerCondition()

TriggerCondition<TBoolEnum, TTriggerEnum> BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.CreateTriggerCondition ( TTriggerEnum  key)
inline

Definition at line 384 of file StateMachine.cs.

385  {
386  return new TriggerCondition<TBoolEnum, TTriggerEnum>(key);
387  }

◆ ExecuteTransitions()

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.ExecuteTransitions ( )
inlineprivate

Run transitions as long as we have a valid one to perform next. Blocks immediate transitions from occuring.

Definition at line 349 of file StateMachine.cs.

References BGC.StateMachine.IStateTrigger< TTriggerEnum >.ActivateTrigger(), BGC.StateMachine.ITransitionDataRetriever< TBoolEnum, TTriggerEnum >.ConsumeTrigger(), BGC.StateMachine.IStateDataBool< TBoolEnum >.GetBool(), BGC.StateMachine.ITransitionDataRetriever< TBoolEnum, TTriggerEnum >.GetBool(), BGC.StateMachine.IStateTrigger< TTriggerEnum >.GetTrigger(), BGC.StateMachine.ITransitionDataRetriever< TBoolEnum, TTriggerEnum >.GetTrigger(), BGC.StateMachine.State.OnEnter(), BGC.StateMachine.Transition< TBoolEnum, TTriggerEnum >.OnTransition(), BGC.StateMachine.IStateDataBool< TBoolEnum >.SetBool(), and BGC.StateMachine.Transition< TBoolEnum, TTriggerEnum >.TargetState.

350  {
351  blockTransitions = true;
352 
353  Transition<TBoolEnum, TTriggerEnum> transition;
354 
355  while ((transition = CheckTransitions()) != null)
356  {
357  transition.OnTransition();
359  CurrentState = transition.TargetState;
361  }
362 
363  blockTransitions = false;
364  }
State CurrentState
Get the name of the current State that the StateMachine is in
Definition: StateMachine.cs:35
Transition< TBoolEnum, TTriggerEnum > CheckTransitions()
Test to see if there is a valid transitions and return it, or null. Clears the dirtyTransitionState f...
void OnExit()
Called when the state is exited, before the next state is entered
Definition: State.cs:59
void OnEnter()
Called when the state is entered
Definition: State.cs:46
Here is the call graph for this function:

◆ GetBool() [1/2]

bool IStateDataBool<TBoolEnum>. BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.GetBool ( TBoolEnum  key)
private

◆ GetBool() [2/2]

bool ITransitionDataRetriever<TBoolEnum, TTriggerEnum>. BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.GetBool ( TBoolEnum  key)
private

◆ GetTrigger() [1/2]

bool IStateTrigger<TTriggerEnum>. BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.GetTrigger ( TTriggerEnum  key)
private

◆ GetTrigger() [2/2]

bool ITransitionDataRetriever<TBoolEnum, TTriggerEnum>. BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.GetTrigger ( TTriggerEnum  key)
private

◆ Log()

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.Log ( string  str)
inlineprivate

Log the string if verbose

Definition at line 403 of file StateMachine.cs.

404  {
405  if (verbose)
406  {
407  Debug.Log(str);
408  }
409  }

◆ Reset()

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.Reset ( bool  restartStateMachine = false)
inline

Reset the state machine by exiting the current state and setting the state to the entry state. If restartStateMachine is set to true then entry state will be entered and the StateMachine will have effectively restarted

Definition at line 294 of file StateMachine.cs.

295  {
296  if (running)
297  {
298  //Prevent escape of current state
299  blockTransitions = true;
301  blockTransitions = false;
302  }
303 
304  CurrentState = null;
305  running = false;
306  dirtyTransitionState = false;
307  stateData.Clear();
308 
309  if (restartStateMachine)
310  {
311  Start();
312  }
313  }
void Start()
Run the first state of the state machine
State CurrentState
Get the name of the current State that the StateMachine is in
Definition: StateMachine.cs:35
void OnExit()
Called when the state is exited, before the next state is entered
Definition: State.cs:59
readonly StateData< TBoolEnum, TTriggerEnum > stateData
Definition: StateMachine.cs:23

◆ SetBool()

void IStateDataBool<TBoolEnum>. BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.SetBool ( TBoolEnum  key,
bool  value 
)
private

◆ SetBoolDeferred()

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.SetBoolDeferred ( TBoolEnum  key,
bool  value 
)
inline

Set a boolean that can affect transitions. Relies upon the eventual calling of either an Update or an Immediate call.

Definition at line 220 of file StateMachine.cs.

221  {
222  Debug.Assert(running,
223  "Setting boolean values when the StateMachine is not running will accomplish nothing");
224 
225  stateData.SetBoolean(key, value);
226  dirtyTransitionState = true;
227  }
readonly StateData< TBoolEnum, TTriggerEnum > stateData
Definition: StateMachine.cs:23

◆ SetBoolImmediate()

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.SetBoolImmediate ( TBoolEnum  key,
bool  value 
)
inline

Set a boolean that can affect transitions. Initiate a transition check if transitions aren't blocked.

Definition at line 199 of file StateMachine.cs.

200  {
201  Debug.Assert(running,
202  "Setting boolean values when the StateMachine is not running will accomplish nothing");
203 
204  stateData.SetBoolean(key, value);
205 
206  if (!blockTransitions)
207  {
209  }
210  else
211  {
212  dirtyTransitionState = true;
213  }
214  }
void ExecuteTransitions()
Run transitions as long as we have a valid one to perform next. Blocks immediate transitions from occ...
readonly StateData< TBoolEnum, TTriggerEnum > stateData
Definition: StateMachine.cs:23

◆ Start()

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.Start ( )
inline

Run the first state of the state machine

Definition at line 265 of file StateMachine.cs.

266  {
267  if (entryState == null)
268  {
269  throw new InvalidOperationException("State machine must have an entry state defined to start.");
270  }
271 
273  running = true;
274  dirtyTransitionState = false;
275  stateData.Initialize();
276 
277  //Block transitions during OnEnter
278  {
279  blockTransitions = true;
281  blockTransitions = false;
282  }
283 
284  //Execute any transitions
286  }
void ExecuteTransitions()
Run transitions as long as we have a valid one to perform next. Blocks immediate transitions from occ...
State CurrentState
Get the name of the current State that the StateMachine is in
Definition: StateMachine.cs:35
void OnEnter()
Called when the state is entered
Definition: State.cs:46
readonly StateData< TBoolEnum, TTriggerEnum > stateData
Definition: StateMachine.cs:23

◆ Update()

void BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.Update ( )
inline

Call update function on the currently active state.

Definition at line 232 of file StateMachine.cs.

References BGC.StateMachine.State.OnEnter().

233  {
234  if (!running)
235  {
236  return;
237  }
238 
239  //Pre-Update check for Transitions
241  {
243  }
244 
245  //Block mid-update transitions
246  {
247  blockTransitions = true;
248  //Update current state
250  blockTransitions = false;
251  }
252 
253  //Post-Update check for Transitions
255  {
257  }
258  }
void ExecuteTransitions()
Run transitions as long as we have a valid one to perform next. Blocks immediate transitions from occ...
virtual void Update()
This can be called every frame or whenever for complex states that have behavior on a frame by X basi...
Definition: State.cs:83
State CurrentState
Get the name of the current State that the StateMachine is in
Definition: StateMachine.cs:35
Here is the call graph for this function:

Field Documentation

◆ anyStateTransitions

readonly List<Transition<TBoolEnum, TTriggerEnum> > BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.anyStateTransitions
private

Definition at line 22 of file StateMachine.cs.

◆ blockTransitions

bool BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.blockTransitions = false
private

Definition at line 30 of file StateMachine.cs.

◆ dirtyTransitionState

bool BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.dirtyTransitionState = false
private

Definition at line 29 of file StateMachine.cs.

◆ entryState

State BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.entryState = null
private

Definition at line 26 of file StateMachine.cs.

◆ running

bool BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.running = false
private

Definition at line 28 of file StateMachine.cs.

◆ stateData

readonly StateData<TBoolEnum, TTriggerEnum> BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.stateData
private

Definition at line 23 of file StateMachine.cs.

◆ stateTransitions

readonly Dictionary<State, List<Transition<TBoolEnum, TTriggerEnum> > > BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.stateTransitions
private

Definition at line 21 of file StateMachine.cs.

◆ verbose

readonly bool BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.verbose
private

Definition at line 24 of file StateMachine.cs.

Property Documentation

◆ CurrentState

State BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.CurrentState
getprivate set

Get the name of the current State that the StateMachine is in

Definition at line 35 of file StateMachine.cs.


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