Olympe Engine
2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Source
_deprecated
Npc.cpp
Go to the documentation of this file.
1
/*
2
Olympe Engine V2 2025
3
Nicolas Chereau
4
nchereau@gmail.com
5
6
Purpose:
7
- Class representing a Non-Player Character (NPC) in the game, derived from GameObject.
8
9
*/
10
11
#include "
Npc.h
"
12
#include "
ObjectFactory.h
"
13
bool
Npc::FactoryRegistered
=
ObjectFactory::Get
().
Register
(
"Npc"
,
Npc::Create
);
14
Object
*
Npc::Create
()
15
{
16
// Create a new Npc instance each time (not static)
17
Npc
*
npc
=
new
Npc
();
18
npc
->name =
"Npc"
;
19
ObjectFactory::Get
().
AddComponent
(
"AI_Npc"
,
npc
);
20
return
npc
;
21
}
GetComponentTypeID_Static
ComponentTypeID GetComponentTypeID_Static()
Definition
ECS_Entity.h:56
Npc.h
ObjectFactory.h
Npc
Definition
Npc.h:15
Npc::Create
static Object * Create()
Definition
Npc.cpp:14
Npc::FactoryRegistered
static bool FactoryRegistered
Definition
Npc.h:22
Npc::Npc
Npc()=default
ObjectFactory::Register
bool Register(const std::string &className, CreatorFunction creator)
Enregistre une fonction de cr�ation pour un nom de classe donn�.
Definition
ObjectFactory.h:66
ObjectFactory::Get
static ObjectFactory & Get()
Definition
ObjectFactory.h:58
ObjectFactory::AddComponent
ObjectComponent * AddComponent(const std::string &className, Object *owner)
Definition
ObjectFactory.h:108
Object
Definition
Object.h:32
Generated on Tue Feb 17 2026 13:49:10 for Olympe Engine by
1.9.8