Raven Engine v0.1
Loading...
Searching...
No Matches
Raven::SceneSerializer Class Reference

Serializes and deserializes a Scene to/from disk. More...

#include <SceneSerializer.h>

Public Member Functions

 SceneSerializer (const Ref< Scene > &scene)
 Constructs a SceneSerializer for a specific Scene.
void Serialize (const std::filesystem::path &filepath)
 Serializes the Scene to the given file path.
void Deserialize (const std::filesystem::path &filepath)
 Deserializes the Scene from the given file path.

Detailed Description

Serializes and deserializes a Scene to/from disk.

This class handles the conversion of Scene data into a storable format (currently only JSON) and vice versa. It works on a reference to a Scene instance provided at construction.

Constructor & Destructor Documentation

◆ SceneSerializer()

Raven::SceneSerializer::SceneSerializer ( const Ref< Scene > & scene)
explicit

Constructs a SceneSerializer for a specific Scene.

Parameters
sceneReference to the Scene object to serialize/deserialize.

Member Function Documentation

◆ Deserialize()

void Raven::SceneSerializer::Deserialize ( const std::filesystem::path & filepath)

Deserializes the Scene from the given file path.

Loads scene data from a JSON file and recreates entities and components.

Parameters
filepathThe filesystem path of the scene file to load.

◆ Serialize()

void Raven::SceneSerializer::Serialize ( const std::filesystem::path & filepath)

Serializes the Scene to the given file path.

Converts the Scene’s entities and components into a JSON file.

Parameters
filepathThe filesystem path where the scene will be saved.

The documentation for this class was generated from the following files: