-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFSMState.h
More file actions
40 lines (36 loc) · 883 Bytes
/
Copy pathFSMState.h
File metadata and controls
40 lines (36 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include "IScriptedFSM.h"
namespace FSM
{
class FSMState : public IScriptedFSM
{
public:
FSMState(const std::string& stateName) : m_stateName(stateName) {}
virtual ~FSMState() = default;
// Called when entering the state
virtual void Enter(BlackBoard& bb) override
{
// Default implementation can be empty or contain common logic
}
// Called every frame while in the state
virtual void Update(BlackBoard& bb, float deltaTime) override
{
// Default implementation can be empty or contain common logic
}
// Called when exiting the state
virtual void Exit(BlackBoard& bb) override
{
// Default implementation can be empty or contain common logic
}
const std::string& GetName() const
{
return m_stateName;
}
void SetName(const std::string& name)
{
m_stateName = name;
}
private:
std::string m_stateName;
};
}