Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
Loading...
Searching...
No Matches

Constructs a scene tree from a file containing its JSON description. More...

#include <scene_loading.hpp>

Inheritance diagram for ToyMaker::SceneFromFile:
ToyMaker::ResourceConstructor< SimObject, SceneFromFile > ToyMaker::IResourceConstructor

Static Public Member Functions

static std::string getResourceConstructorName ()
 The resource constructor type string associated with this constructor.
 

Private Member Functions

std::shared_ptr< IResourcecreateResource (const nlohmann::json &methodParams)
 Creates a resource from its JSON description stored in a file at the path specified.
 

Additional Inherited Members

- Public Member Functions inherited from ToyMaker::ResourceConstructor< SimObject, SceneFromFile >
std::string getResourceConstructorName_ () const override
 Gets the resource constructor type string of the constructor.
 
- Public Member Functions inherited from ToyMaker::IResourceConstructor
virtual ~IResourceConstructor ()=default
 Destroys this resource constructor (when the application is terminated.)
 
- Protected Member Functions inherited from ToyMaker::ResourceConstructor< SimObject, SceneFromFile >
 ResourceConstructor (int explicitlyInitializeMe)
 Construct a new ResourceConstructor object.
 
- Protected Member Functions inherited from ToyMaker::IResourceConstructor
 IResourceConstructor ()=default
 Construct a new IResourceConstructor object.
 
- Static Protected Member Functions inherited from ToyMaker::IResourceConstructor
template<typename TResource, typename TResourceConstructor>
static void RegisterResourceConstructor ()
 Registers this resource constructor against its respective ResourceFactory during static initialization.
 

Detailed Description

Constructs a scene tree from a file containing its JSON description.

Its appearance in JSON might be as follows:

{
"name": "Ur_Button",
"type": "SimObject",
"method": "fromSceneFile",
"parameters": {
"path": "data/ur_button.json"
}
}
See also
SceneFromDescription

Member Function Documentation

◆ createResource()

std::shared_ptr< IResource > SceneFromFile::createResource ( const nlohmann::json & methodParams)
privatevirtual

Creates a resource from its JSON description stored in a file at the path specified.

Parameters
methodParamsThe parameters based on which the scene should be created.
Returns
std::shared_ptr<IResource> Handle to the resource base pointer of the root node of the newly created scene.

Implements ToyMaker::IResourceConstructor.

◆ getResourceConstructorName()

static std::string ToyMaker::SceneFromFile::getResourceConstructorName ( )
inlinestatic

The resource constructor type string associated with this constructor.

Returns
std::string This constructor's resource constructor type string.

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