From d8fabca00814c4cceb9f0533252be8cbe1356234 Mon Sep 17 00:00:00 2001 From: ThomasAvans Date: Mon, 15 Apr 2024 15:48:55 +0200 Subject: Added Finite State Machine implementation --- main/puzzle/fsm/IBehaviouralState.hpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 main/puzzle/fsm/IBehaviouralState.hpp (limited to 'main/puzzle/fsm/IBehaviouralState.hpp') diff --git a/main/puzzle/fsm/IBehaviouralState.hpp b/main/puzzle/fsm/IBehaviouralState.hpp new file mode 100644 index 0000000..c41fef3 --- /dev/null +++ b/main/puzzle/fsm/IBehaviouralState.hpp @@ -0,0 +1,25 @@ +#ifndef _FSM_IBEHAVIOURALSTATE_HPP_ +#define _FSM_IBEHAVIOURALSTATE_HPP_ + +/// +/// Sub class used to define methods implemented by behavioural specific states. +/// +class IBehaviouralState { +public: + /// + /// Enters the current state. Used for setup. + /// + virtual void enter() = 0; + + /// + /// Updates the current state, used for physics, etc. + /// + virtual void act() = 0; + + /// + /// Exits the state, used for cleanup. + /// + virtual void exit() = 0; +}; + +#endif // _FSM_IBEHAVIOURALSTATE_HPP_ \ No newline at end of file -- cgit v1.2.3