Copperfield Engine 0.1
C++ Game Engine
Loading...
Searching...
No Matches
component_lists.hpp
Go to the documentation of this file.
1#pragma once
2#include <optional>
3
6
8enum class ComponentListType {
10 kSparse
11};
12
14class ComponentListBase {
15public:
16 friend class ComponentManager;
17
20 ComponentListBase(ComponentListType t) : type_{t} {}
21
24
25 virtual ~ComponentListBase() = default;
26 ComponentListBase(const ComponentListBase& o ) = delete;
27 ComponentListBase(ComponentListBase&& o) = delete;
28 ComponentListBase& operator= (const ComponentListBase& o) = delete;
29 ComponentListBase& operator= (ComponentListBase&& o) = delete;
30
31protected:
36 virtual bool addEntity(unsigned e) = 0;
37
38
39 virtual bool moveComponent(unsigned src, unsigned dst) = 0;
40
44 virtual bool removeComponent(unsigned e) = 0;
45};
Handles anything related to entities and components in the engine.
Definition: component_manager.hpp:29
ComponentListType
type of container to be used for storing componets
Definition: component_lists.hpp:8
@ kSparse
should be used for compnents that are used by most entities
@ kCompact
should be used for compoenents used by few entities