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

A bool condition checks for booleans, similar to the trigger condition, but will not consume the boolean once it has been used. Instead it keeps the value exactly as it was when a transition occurs. More...

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

Public Member Functions

 BoolCondition (TBoolEnum key, bool val)
 Build a boolean condition that checks the state machine boolean dictionary and will call for a transition when the expected value is found More...
 
override void OnTransition ()
 Not used More...
 
override bool ShouldTransition ()
 Returns true when the correct value specified during construction is seen More...
 
- Public Member Functions inherited from BGC.StateMachine.TransitionCondition< TBoolEnum, TTriggerEnum >
void SetStateMachineFunctions (ITransitionDataRetriever< TBoolEnum, TTriggerEnum > stateMachine)
 Sets the required functions for the transition that it has received from the state machine. More...
 

Protected Member Functions

override void StateMachineFunctionsSet ()
 Not used More...
 

Private Attributes

readonly TBoolEnum key
 Key to access required boolean in state machine More...
 
readonly bool val
 Expected boolean value for when this condition should call for a transition More...
 

Additional Inherited Members

- Protected Attributes inherited from BGC.StateMachine.TransitionCondition< TBoolEnum, TTriggerEnum >
ITransitionDataRetriever< TBoolEnum, TTriggerEnum > stateMachine
 

Detailed Description

A bool condition checks for booleans, similar to the trigger condition, but will not consume the boolean once it has been used. Instead it keeps the value exactly as it was when a transition occurs.

Type Constraints
TBoolEnum :Enum 
TTriggerEnum :Enum 

Definition at line 10 of file BoolCondition.cs.

Constructor & Destructor Documentation

◆ BoolCondition()

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

Build a boolean condition that checks the state machine boolean dictionary and will call for a transition when the expected value is found

Definition at line 30 of file BoolCondition.cs.

31  {
32  this.key = key;
33  this.val = val;
34  }
readonly bool val
Expected boolean value for when this condition should call for a transition
readonly TBoolEnum key
Key to access required boolean in state machine

Member Function Documentation

◆ OnTransition()

override void BGC.StateMachine.BoolCondition< TBoolEnum, TTriggerEnum >.OnTransition ( )
inlinevirtual

Not used

Implements BGC.StateMachine.TransitionCondition< TBoolEnum, TTriggerEnum >.

Definition at line 39 of file BoolCondition.cs.

40  {
41  // pass
42  }

◆ ShouldTransition()

override bool BGC.StateMachine.BoolCondition< TBoolEnum, TTriggerEnum >.ShouldTransition ( )
virtual

Returns true when the correct value specified during construction is seen

Implements BGC.StateMachine.TransitionCondition< TBoolEnum, TTriggerEnum >.

◆ StateMachineFunctionsSet()

override void BGC.StateMachine.BoolCondition< TBoolEnum, TTriggerEnum >.StateMachineFunctionsSet ( )
inlineprotectedvirtual

Not used

Implements BGC.StateMachine.TransitionCondition< TBoolEnum, TTriggerEnum >.

Definition at line 53 of file BoolCondition.cs.

54  {
55  // pass
56  }

Field Documentation

◆ key

readonly TBoolEnum BGC.StateMachine.BoolCondition< TBoolEnum, TTriggerEnum >.key
private

Key to access required boolean in state machine

Definition at line 17 of file BoolCondition.cs.

◆ val

readonly bool BGC.StateMachine.BoolCondition< TBoolEnum, TTriggerEnum >.val
private

Expected boolean value for when this condition should call for a transition

Definition at line 23 of file BoolCondition.cs.


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