Radium Engine  1.5.20
Loading...
Searching...
No Matches
EntityManager.hpp
1#pragma once
2
3#include <Engine/RaEngine.hpp>
4
5#include <map>
6#include <memory>
7#include <string>
8#include <vector>
9
10#include <Core/Utils/IndexMap.hpp>
11#include <Core/Utils/Singleton.hpp>
12
13namespace Ra {
14namespace Engine {
15namespace Scene {
16
17class Entity;
18
19class RA_ENGINE_API EntityManager
20{
21 public:
23 EntityManager();
24
25 // Entity manager is non-copyable
26 EntityManager( const EntityManager& ) = delete;
27 EntityManager& operator=( const EntityManager& ) = delete;
28
30 virtual ~EntityManager();
31
38 Entity* createEntity( const std::string& name = "" );
39
45 bool entityExists( const std::string& name ) const;
46
51 void removeEntity( Core::Utils::Index idx );
52
57 void removeEntity( Entity* entity );
58
64 Entity* getEntity( Core::Utils::Index idx ) const;
65
72 std::vector<Entity*> getEntities() const;
73
74 void swapBuffers();
75
81 Entity* getEntity( const std::string& name ) const;
82
86 void deleteEntities();
87
88 private:
89 Core::Utils::IndexMap<std::unique_ptr<Entity>> m_entities;
91};
92
93} // namespace Scene
94} // namespace Engine
95} // namespace Ra
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3