FSMBehavior

FSMBehavior is a class derived from Behavior which stores a finite state machine, executes logic contained in the current state and transitions to other states when transition conditions are met.

Important methods

Constructors

There are two different constructors for this class:
  1. The first one needs a list of transitions, the initial state, and the state machine's name. Basically it functions just as one of the constructors of a state machine.

  2. The second one needs a reference to an already existing state machine. This one allows you to use your custom override of the default state machine or use a builder

  • C++

  • C#

grail::fsm::FSMBehavior firstBehavior{transitions, initialState, "first fsm behavior"};
grail::fsm::FSMBehavior secondBehavior{std::move(myStateMachine)};
Grail.FSM.FSMBehavior firstBehavior = new(transitions, initialState, "first fsm behavior");
Grail.FSM.FSMBehavior secondBehavior = new(myStateMachine);

Is Finished

An overridden method from Behavior class. This behavior is always running and never finishes.

An overridden method from Behavior class. This behavior is always legal by default. Can be overriden by a user to make this behavior compatible with different decision making techniques.

API Reference