Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
AI_Npc.h
Go to the documentation of this file.
1#pragma once
2#include "ObjectComponent.h"
4#include <SDL3/SDL.h>
5#include <mutex>
6// AI_Npc: component that implements basic NPC behavior (e.g., patrolling)
7class AI_Npc : public AIComponent
8{
9 public:
10 static bool FactoryRegistered;
11 static ObjectComponent* Create(void);
12 explicit AI_Npc();
13 virtual ~AI_Npc() override;
14 virtual void SetOwner(Object* _owner) override;
15 // AI properties participate in the AI stage (AIComponent already does this)
16 virtual void Process() override {}
17 virtual void OnEvent(const Message& msg) override;
18private:
19 // NPC behavior state
20 enum class State
21 {
22 Idle,
24 Chasing,
26 };
28 std::mutex m_mutex;
29};
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
Definition AI_Npc.h:8
static ObjectComponent * Create(void)
Definition AI_Npc.cpp:10
State m_currentState
Definition AI_Npc.h:27
virtual void Process() override
Definition AI_Npc.h:16
virtual void SetOwner(Object *_owner) override
Definition AI_Npc.cpp:25
std::mutex m_mutex
Definition AI_Npc.h:28
AI_Npc()
Definition AI_Npc.cpp:15
virtual void OnEvent(const Message &msg) override
Definition AI_Npc.cpp:36
virtual ~AI_Npc() override
Definition AI_Npc.cpp:21
State
Definition AI_Npc.h:21
static bool FactoryRegistered
Definition AI_Npc.h:10