SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
Scene.h
1#pragma once
2
3#include "spark/core/Export.h"
4#include "spark/core/GameObject.h"
5
6#include "experimental/ser/SerializerScheme.h"
7#include "spark/lib/Uuid.h"
8#include "spark/rtti/HasRtti.h"
9
10namespace spark::core
11{
12 class SPARK_CORE_EXPORT Scene final : public rtti::HasRtti
13 {
14 DECLARE_SPARK_RTTI(Scene)
15 SPARK_ALLOW_PRIVATE_SERIALIZATION
16
17 public:
18 explicit Scene(GameObject* scene_root);
19 ~Scene() override;
20
21 Scene(const Scene& other) = delete;
22 Scene(Scene&& other) noexcept = default;
23 Scene& operator=(const Scene& other) = delete;
24 Scene& operator=(Scene&& other) noexcept = default;
25
30 [[nodiscard]] const lib::Uuid& uuid() const;
31
36 [[nodiscard]] GameObject* root();
37
41 void onLoad();
42
46 void onUpdate(float dt);
47
51 void onRender();
52
56 void onUnload();
57
58 private:
59 lib::Uuid m_uuid;
60 GameObject* m_root = nullptr;
61 bool m_isLoaded = false;
62 };
63}
64
65IMPLEMENT_SPARK_RTTI(spark::core::Scene)
A GameObject is any object in the game. It contains a list of components that provides functionality ...
Definition GameObject.h:26
Definition Scene.h:13
A 128-bit universally unique identifier (UUID).
Definition Uuid.h:22
The class anything using the RTTI should implement.
Definition HasRtti.h:16