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

A trigger condition, similar to the bool condition, will transition while a trigger is active. Once consumed, it will not transition. On a transition, it will consume the trigger it is associated with. More...

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

Public Member Functions

 TriggerCondition (TTriggerEnum key)
 Construct a trigger condition with the key that will be checked in the triggers dictionary. More...
 
override void OnTransition ()
 On transition, a trigger will always be consumed More...
 
override bool ShouldTransition ()
 If the required trigger has been activated this will return true until it has been consumed 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 ()
 A transition receives information from the state machine on construction, however, the transition condition will send the functions to all it contains More...
 

Private Attributes

readonly TTriggerEnum key
 Key to check state data triggers More...
 

Additional Inherited Members

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

Detailed Description

A trigger condition, similar to the bool condition, will transition while a trigger is active. Once consumed, it will not transition. On a transition, it will consume the trigger it is associated with.

Type Constraints
TBoolEnum :Enum 
TTriggerEnum :Enum 

Definition at line 10 of file TriggerCondition.cs.

Constructor & Destructor Documentation

◆ TriggerCondition()

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

Construct a trigger condition with the key that will be checked in the triggers dictionary.

Definition at line 24 of file TriggerCondition.cs.

25  {
26  this.key = key;
27  }
readonly TTriggerEnum key
Key to check state data triggers

Member Function Documentation

◆ OnTransition()

override void BGC.StateMachine.TriggerCondition< TBoolEnum, TTriggerEnum >.OnTransition ( )
virtual

On transition, a trigger will always be consumed

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

◆ ShouldTransition()

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

If the required trigger has been activated this will return true until it has been consumed

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

◆ StateMachineFunctionsSet()

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

A transition receives information from the state machine on construction, however, the transition condition will send the functions to all it contains

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

Definition at line 40 of file TriggerCondition.cs.

41  {
42  // pass
43  }

Field Documentation

◆ key

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

Key to check state data triggers

Definition at line 18 of file TriggerCondition.cs.


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