3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace::Projects::Serializer Class Reference

Handles object and project loading/unloading. More...

#include <Serialization.hpp>

Public Member Functions

 Serializer ()=delete
 Static class.

Static Public Member Functions

static json SerializeObject (Objects::IObject *obj)
 Serializes a object into JSON.
static Objects::IObject * DeserializeObject (const json &j)
 Creates an object from JSON data.
static bool LoadProject (Objects::ObjectList *lst, Content::ContentManager *content, const std::filesystem::path &projectPath)
static Objects::IObject * LoadObjectFromProject (const std::filesystem::path &path, unsigned id)
 Loads a single object from a project file. Used when resetting objects.
static bool SaveProject (Objects::ObjectList *lst, Content::ContentManager *content, const std::filesystem::path &projectPath)
 Saves all the objects and asset data into a 3DRSP file.

Detailed Description

Handles object and project loading/unloading.

Constructor & Destructor Documentation

◆ Serializer()

Engine3DRadSpace::Projects::Serializer::Serializer ( )
delete

Static class.

Member Function Documentation

◆ DeserializeObject()

IObject * Engine3DRadSpace::Projects::Serializer::DeserializeObject ( const json & j)
staticnodiscard

Creates an object from JSON data.

Parameters
jJSON data, usually from a project file.
Returns
Newly allocated object. Must be freed.

◆ LoadObjectFromProject()

IObject * Engine3DRadSpace::Projects::Serializer::LoadObjectFromProject ( const std::filesystem::path & path,
unsigned id )
staticnodiscard

Loads a single object from a project file. Used when resetting objects.

Parameters
pathPath to project.
idObject ID.
Returns
Newly allocated object. Must be freed.

◆ LoadProject()

bool Engine3DRadSpace::Projects::Serializer::LoadProject ( Objects::ObjectList * lst,
Content::ContentManager * content,
const std::filesystem::path & projectPath )
static

◆ SaveProject()

bool Engine3DRadSpace::Projects::Serializer::SaveProject ( Objects::ObjectList * lst,
Content::ContentManager * content,
const std::filesystem::path & projectPath )
static

Saves all the objects and asset data into a 3DRSP file.

Parameters
lstObject list.
contentContent manager.
projectPathFile to save to.
Returns
True if succeded.

◆ SerializeObject()

json Engine3DRadSpace::Projects::Serializer::SerializeObject ( Objects::IObject * obj)
static

Serializes a object into JSON.

Parameters
objReference to an object.
Returns
JSON data.

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