KSP API
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
Public Member Functions | Public Attributes | List of all members
KFSMEvent Class Reference

A KFSMEvent represents a possible transition between two KFSMStates in a KerbalFSM finite state machine. More...

Public Member Functions

 KFSMEvent (string name)
 Creates a new KFSMEvent More...
 
bool IsValid (KFSMState state)
 Whether this event can be triggered when the state machine is in the given state. Events must be added to states through KerbalFSM.AddEvent before they can be triggered, and they can only be triggered when the machine is in one of the states to which they have been added. More...
 

Public Attributes

KFSMState GoToStateOnEvent
 Which state to transition to when this event is triggered. More...
 
string name
 The name of the event. More...
 
KFSMEventCondition OnCheckCondition
 You can assign to this field a delegate that takes a KFSMState (the current state) and returns a bool. The function will be called each frame and if it returns true, the event is triggered. More...
 
KFSMCallback OnEvent
 You can assign a delegate to this field, and the delegate will be run when the event is triggered. More...
 
KFSMUpdateMode updateMode
 Specifies when OnCheckCondition should be checked? More...
 

Detailed Description

A KFSMEvent represents a possible transition between two KFSMStates in a KerbalFSM finite state machine.

Constructor & Destructor Documentation

KFSMEvent.KFSMEvent ( string  name)

Creates a new KFSMEvent

Parameters
nameThe name of the event.

Member Function Documentation

bool KFSMEvent.IsValid ( KFSMState  state)

Whether this event can be triggered when the state machine is in the given state. Events must be added to states through KerbalFSM.AddEvent before they can be triggered, and they can only be triggered when the machine is in one of the states to which they have been added.

Parameters
stateThe state to check.
Returns
Whether the event can be triggered from the given state.

Member Data Documentation

KFSMState KFSMEvent.GoToStateOnEvent

Which state to transition to when this event is triggered.

string KFSMEvent.name

The name of the event.

KFSMEventCondition KFSMEvent.OnCheckCondition

You can assign to this field a delegate that takes a KFSMState (the current state) and returns a bool. The function will be called each frame and if it returns true, the event is triggered.

KFSMCallback KFSMEvent.OnEvent

You can assign a delegate to this field, and the delegate will be run when the event is triggered.

KFSMUpdateMode KFSMEvent.updateMode

Specifies when OnCheckCondition should be checked?


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