BGC Tools
Public Member Functions | Protected Member Functions | Private Attributes
BGC.StateMachine.CoordinatingState< TBoolEnum, TTriggerEnum > Class Template Reference
Inheritance diagram for BGC.StateMachine.CoordinatingState< TBoolEnum, TTriggerEnum >:
Inheritance graph
[legend]
Collaboration diagram for BGC.StateMachine.CoordinatingState< TBoolEnum, TTriggerEnum >:
Collaboration graph
[legend]

Public Member Functions

 CoordinatingState ()
 Create a coordinating state with the default name More...
 
 CoordinatingState (string name)
 Create a coordinate state with a custom name rather than the default More...
 
void SetStateMachineFunctions (IStateDataBool< TBoolEnum > booleans, IStateTrigger< TTriggerEnum > triggers)
 Receive state machine related functions that give states required behaviour More...
 
- Public Member Functions inherited from BGC.StateMachine.State
 State ()
 Create a state with the default name More...
 
 State (string name)
 Create a state with a custom name rather than the default More...
 
void OnEnter ()
 Called when the state is entered More...
 
void OnExit ()
 Called when the state is exited, before the next state is entered More...
 
virtual void Update ()
 This can be called every frame or whenever for complex states that have behavior on a frame by X basis. More...
 
void SetVerbose (bool isVerbose)
 Set whether the state machine is verbose or not More...
 

Protected Member Functions

void ActivateTrigger (TTriggerEnum key)
 Activate a trigger in the state machine this state is a part of More...
 
void SetBool (TBoolEnum key, bool val)
 Set a bool in the state machine this state is a part of More...
 
bool GetBool (TBoolEnum key)
 Get a bool from the state machine this state is a part of More...
 
- Protected Member Functions inherited from BGC.StateMachine.State
abstract void OnStateEnter ()
 Called when the state is entered More...
 
virtual void OnStateExit ()
 Called when the state is exited before the next state is entered More...
 

Private Attributes

IStateTrigger< TTriggerEnum > stateTriggers
 
IStateDataBool< TBoolEnum > stateBooleans
 

Additional Inherited Members

- Protected Attributes inherited from BGC.StateMachine.State
virtual string DefaultName => "State"
 
- Properties inherited from BGC.StateMachine.State
string Name [get, private set]
 Name of the state. This will either be user defined or the default state name depending on the constructor used More...
 

Detailed Description

Type Constraints
TBoolEnum :Enum 
TTriggerEnum :Enum 

Definition at line 5 of file CoordinatingState.cs.

Constructor & Destructor Documentation

◆ CoordinatingState() [1/2]

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

Create a coordinating state with the default name

Definition at line 15 of file CoordinatingState.cs.

15  : base()
16  {
17  }

◆ CoordinatingState() [2/2]

BGC.StateMachine.CoordinatingState< TBoolEnum, TTriggerEnum >.CoordinatingState ( string  name)
inline

Create a coordinate state with a custom name rather than the default

Definition at line 22 of file CoordinatingState.cs.

22  : base(name)
23  {
24  }

Member Function Documentation

◆ ActivateTrigger()

void BGC.StateMachine.CoordinatingState< TBoolEnum, TTriggerEnum >.ActivateTrigger ( TTriggerEnum  key)
protected

Activate a trigger in the state machine this state is a part of

Parameters
key
Returns

◆ GetBool()

bool BGC.StateMachine.CoordinatingState< TBoolEnum, TTriggerEnum >.GetBool ( TBoolEnum  key)
protected

Get a bool from the state machine this state is a part of

Parameters
key
Returns

◆ SetBool()

void BGC.StateMachine.CoordinatingState< TBoolEnum, TTriggerEnum >.SetBool ( TBoolEnum  key,
bool  val 
)
protected

Set a bool in the state machine this state is a part of

Parameters
key
val
Returns

◆ SetStateMachineFunctions()

void BGC.StateMachine.CoordinatingState< TBoolEnum, TTriggerEnum >.SetStateMachineFunctions ( IStateDataBool< TBoolEnum >  booleans,
IStateTrigger< TTriggerEnum >  triggers 
)
inline

Receive state machine related functions that give states required behaviour

Definition at line 29 of file CoordinatingState.cs.

References BGC.StateMachine.IStateTrigger< TTriggerEnum >.ActivateTrigger(), BGC.StateMachine.IStateDataBool< TBoolEnum >.GetBool(), and BGC.StateMachine.IStateDataBool< TBoolEnum >.SetBool().

Referenced by BGC.StateMachine.StateMachine< TBoolEnum, TTriggerEnum >.AddState().

30  {
31  stateTriggers = triggers ?? throw new ArgumentNullException(
32  paramName: nameof(triggers),
33  message: "stateMachine cannot be null.");
34 
35  stateBooleans = booleans ?? throw new ArgumentNullException(
36  paramName: nameof(booleans),
37  message: "stateMachine cannot be null.");
38  }
IStateTrigger< TTriggerEnum > stateTriggers
IStateDataBool< TBoolEnum > stateBooleans
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ stateBooleans

IStateDataBool<TBoolEnum> BGC.StateMachine.CoordinatingState< TBoolEnum, TTriggerEnum >.stateBooleans
private

Definition at line 10 of file CoordinatingState.cs.

◆ stateTriggers

IStateTrigger<TTriggerEnum> BGC.StateMachine.CoordinatingState< TBoolEnum, TTriggerEnum >.stateTriggers
private

Definition at line 9 of file CoordinatingState.cs.


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