Leviathan  0.8.0.0
Leviathan game engine
Component.h
Go to the documentation of this file.
1 // Leviathan Game Engine
2 // Copyright (c) 2012-2018 Henri Hyyryläinen
3 #pragma once
4 // ------------------------------------ //
5 #include "Define.h"
6 
7 #include "Common/ObjectPool.h"
8 #include "Common/SFMLPackets.h"
9 #include "EntityCommon.h"
10 
11 #include <limits>
12 
13 // No clue where this is coming from...
14 #ifdef _WIN32
15 #undef max
16 #endif
17 
18 namespace Leviathan {
19 
21 enum class COMPONENT_TYPE : uint16_t {
22 
23  Position,
24 
26  RenderNode,
27 
28  Sendable,
29 
30  Received,
31 
32  Physics,
33 
35 
36  Model,
37 
39 
40  Camera,
41 
42  Plane,
43 
44  Animated,
45 
47  Custom = 10000
48 };
49 
50 
52 class Component {
53 public:
54  inline Component(COMPONENT_TYPE type) : Marked(true), Type(type){};
55 
59  bool Marked;
60 
63 
64  Component(const Component&) = delete;
65  Component& operator=(const Component&) = delete;
66 };
67 
68 template<class ComponentType>
69 class ComponentHolder : public ObjectPoolTracked<ComponentType, ObjectID> {
70 public:
71 };
72 } // namespace Leviathan
73 
74 #ifdef LEAK_INTO_GLOBAL
76 #endif // LEAK_INTO_GLOBAL
All values above this are application specific types.
COMPONENT_TYPE
Must contain all valid Component types.
Definition: Component.h:21
Component(COMPONENT_TYPE type)
Definition: Component.h:54
const COMPONENT_TYPE Type
Type of this component, used for network serialization.
Definition: Component.h:62
Creates objects in a shared memory region.
Definition: ObjectPool.h:312
unsigned short uint16_t
Definition: core.h:39
Component & operator=(const Component &)=delete
Base class for all components.
Definition: Component.h:52
The access mask controls which registered functions and classes a script sees.
Definition: GameModule.h:12