30 lines
542 B
C++
30 lines
542 B
C++
#pragma once
|
|
|
|
|
|
#include <engine/scene/entity.hpp>
|
|
#include <engine/scene/scene.hpp>
|
|
#include <yaml-cpp/yaml.h>
|
|
|
|
namespace lt {
|
|
|
|
class SceneSerializer
|
|
{
|
|
public:
|
|
SceneSerializer(const Ref<Scene> &scene);
|
|
|
|
void serialize(const std::string &filePath);
|
|
|
|
auto deserialize(const std::string &file_path) -> bool;
|
|
|
|
void serialize_binary(const std::string &file_path);
|
|
|
|
auto deserialize_binary(const std::string &file_path) -> bool;
|
|
|
|
private:
|
|
Ref<Scene> m_scene;
|
|
|
|
void serialize_entity(YAML::Emitter &out, Entity entity);
|
|
};
|
|
|
|
|
|
} // namespace lt
|