SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
Registries.h
1#pragma once
2
3#include "spark/core/Component.h"
4#include "spark/core/Export.h"
5#include "spark/core/GameObject.h"
6
7#include "experimental/ser/FileSerializer.h"
8#include "experimental/ser/SerializationRegistry.h"
9#include "spark/patterns/Factory.h"
10
11namespace spark::core
12{
18 class SPARK_CORE_EXPORT GameObjectRegistry final : public patterns::Factory<std::string, core::GameObject, std::string, core::GameObject*>,
19 public experimental::ser::SerializationRegistry<experimental::ser::FileSerializer, std::string, core::GameObject>
20 {
21 public:
25 explicit GameObjectRegistry();
26
31 template <typename T> requires std::derived_from<T, core::GameObject>
32 void registerType();
33 };
34
40 class SPARK_CORE_EXPORT ComponentRegistry final : public patterns::Factory<std::string, core::Component, core::GameObject*>,
41 public experimental::ser::SerializationRegistry<experimental::ser::FileSerializer, std::string, core::Component>
42 {
43 public:
47 explicit ComponentRegistry();
48
53 template <typename T> requires std::derived_from<T, core::Component>
54 void registerType();
55 };
56}
57
58#include "spark/core/impl/Registries.h"
A registry used to create Component instances and get serialization objects for it.
Definition Registries.h:42
A registry used to create GameObject instances and get serialization objects for it.
Definition Registries.h:20
A factory class that creates objects of type BaseType.
Definition Factory.h:19