Grindstone Game Engine
v0.2.0
An open source game engine and toolkit.
Toggle main menu visibility
Loading...
Searching...
No Matches
System.hpp
1
#pragma once
2
3
#include <cinttypes>
4
5
namespace
Grindstone {
6
class
Scene;
7
8
namespace
ECS {
9
using
SystemType = std::uint8_t;
10
const
SystemType MAX_SYSTEMS = UINT8_MAX;
11
const
SystemType INVALID_SYSTEM = UINT8_MAX;
12
13
class
ISystem
{
14
public
:
15
virtual
void
update() = 0;
16
17
Scene *scene_;
18
SystemType system_type_;
19
};
20
}
21
}
22
23
#define SYSTEM_BODY(T) static Grindstone::ECS::SystemType static_system_type_; \
24
static const char *system_name_; \
25
T(Grindstone::Scene *s) { scene_ = s; system_type_ = Grindstone::ECS::INVALID_SYSTEM; } \
26
static Grindstone::ECS::ISystem* createSystem(Grindstone::Scene *s) { return Grindstone::Memory::AllocatorCore::Allocate<T>(s); }
27
#define SYSTEM_DEFINE(T, Name) Grindstone::ECS::SystemType T::static_system_type_ = 0; const char * T::system_name_ = Name
Grindstone::ECS::ISystem
Definition
System.hpp:13
sources
code
EngineCore
ECS
System.hpp
Generated by
1.17.0