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

Simple State with optional lambda arguments for OnStateEnter, OnStateExit, and Update. More...

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

Public Member Functions

 UpdatingLambdaState (string name, Action onStateEnter=null, Action onStateExit=null, Action update=null)
 
override void Update ()
 This can be called every frame or whenever for complex states that have behavior on a frame by X basis. 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...
 
void SetVerbose (bool isVerbose)
 Set whether the state machine is verbose or not More...
 

Protected Member Functions

override void OnStateEnter ()
 Called when the state is entered More...
 
override void OnStateExit ()
 Called when the state is exited before the next state is entered More...
 

Private Attributes

readonly Action onStateEnter
 
readonly Action onStateExit
 
readonly Action update
 

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

Simple State with optional lambda arguments for OnStateEnter, OnStateExit, and Update.

Definition at line 9 of file UpdatingLambdaState.cs.

Constructor & Destructor Documentation

◆ UpdatingLambdaState()

BGC.StateMachine.UpdatingLambdaState< TBoolEnum, TTriggerEnum >.UpdatingLambdaState ( string  name,
Action  onStateEnter = null,
Action  onStateExit = null,
Action  update = null 
)
inline

Definition at line 15 of file UpdatingLambdaState.cs.

20  : base(name)
21  {
22  Debug.Assert(update != null);
23 
25  this.onStateExit = onStateExit;
26  this.update = update;
27  }

Member Function Documentation

◆ OnStateEnter()

override void BGC.StateMachine.UpdatingLambdaState< TBoolEnum, TTriggerEnum >.OnStateEnter ( )
protectedvirtual

Called when the state is entered

Implements BGC.StateMachine.State.

◆ OnStateExit()

override void BGC.StateMachine.UpdatingLambdaState< TBoolEnum, TTriggerEnum >.OnStateExit ( )
protectedvirtual

Called when the state is exited before the next state is entered

Reimplemented from BGC.StateMachine.State.

◆ Update()

override void BGC.StateMachine.UpdatingLambdaState< TBoolEnum, TTriggerEnum >.Update ( )
virtual

This can be called every frame or whenever for complex states that have behavior on a frame by X basis.

Reimplemented from BGC.StateMachine.State.

Field Documentation

◆ onStateEnter

readonly Action BGC.StateMachine.UpdatingLambdaState< TBoolEnum, TTriggerEnum >.onStateEnter
private

Definition at line 11 of file UpdatingLambdaState.cs.

◆ onStateExit

readonly Action BGC.StateMachine.UpdatingLambdaState< TBoolEnum, TTriggerEnum >.onStateExit
private

Definition at line 12 of file UpdatingLambdaState.cs.

◆ update

readonly Action BGC.StateMachine.UpdatingLambdaState< TBoolEnum, TTriggerEnum >.update
private

Definition at line 13 of file UpdatingLambdaState.cs.


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