Just™ Game Engine
scene_serializer.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 Konstanty Misiak
3 *
4 * SPDX-License-Identifier: MIT
5 */
6
7#pragma once
8#include <jng/scene/scene.hpp>
9
10namespace YAML {
11
12 class Emitter;
13
14} // namespace YAML
15
16namespace jng {
17
19 {
20 public:
21 explicit SceneSerializer(const Ref<Scene>& scene) : m_scene{ scene } {}
22
23 void serialize(const std::filesystem::path& path);
24 void deserialize(const std::filesystem::path& path);
25 private:
26 void serializeEntity(Entity entity, YAML::Emitter& yaml);
27
28 Ref<Scene> m_scene;
29 };
30
31} // namespace jng
Definition: entity.hpp:17
Definition: scene_serializer.hpp:19
void deserialize(const std::filesystem::path &path)
Definition: scene_serializer.cpp:135
SceneSerializer(const Ref< Scene > &scene)
Definition: scene_serializer.hpp:21
void serialize(const std::filesystem::path &path)
Definition: scene_serializer.cpp:113
Definition: scene_serializer.hpp:10
Definition: base.hpp:11
std::shared_ptr< T > Ref
Definition: base.hpp:32