Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
|
Constructs a scene tree (separate from the scene tree) based on its description in JSON. More...
#include <scene_loading.hpp>
Static Public Member Functions | |
static std::string | getResourceConstructorName () |
Gets this constructor's resource constructor type string. | |
Private Member Functions | |
void | loadResources (const nlohmann::json &resourceList) |
Loads the resources listed in the resource section of this scene description. | |
std::shared_ptr< SimObject > | loadSceneNodes (const nlohmann::json &nodeList) |
Loads the scene nodes listed in the "nodes" section of the scene description. | |
void | loadConnections (const nlohmann::json &connectionList, std::shared_ptr< SceneNodeCore > localRoot) |
Loads connections between nodes (functioning as SignalTrackers) within a scene. | |
void | overrideComponents (std::shared_ptr< SimObject > node, const nlohmann::json &componentList) |
(When used as a node in another scene) a list of overrides to ECSWorld components to be applied to the root node of an imported scene. | |
void | overrideAspects (std::shared_ptr< SimObject > node, const nlohmann::json &aspectList) |
(When used as a node in another scene) a list of overrides to SimObjectAspects to be applied to the root node of an imported scene. | |
std::shared_ptr< IResource > | createResource (const nlohmann::json &methodParams) override |
Actually creates a scene tree out of its JSON description. | |
Additional Inherited Members | |
![]() | |
std::string | getResourceConstructorName_ () const override |
Gets the resource constructor type string of the constructor. | |
![]() | |
virtual | ~IResourceConstructor ()=default |
Destroys this resource constructor (when the application is terminated.) | |
![]() | |
ResourceConstructor (int explicitlyInitializeMe) | |
Construct a new ResourceConstructor object. | |
![]() | |
IResourceConstructor ()=default | |
Construct a new IResourceConstructor object. | |
![]() | |
template<typename TResource, typename TResourceConstructor> | |
static void | RegisterResourceConstructor () |
Registers this resource constructor against its respective ResourceFactory during static initialization. | |
Constructs a scene tree (separate from the scene tree) based on its description in JSON.
It will have, as its root, a SimObject which serves (or is intended to serve) as the interface between it and the scene it was imported into.
An example of such a json description is given below:
|
overrideprivatevirtual |
Actually creates a scene tree out of its JSON description.
methodParams | The scene's description in JSON. |
Implements ToyMaker::IResourceConstructor.
|
inlinestatic |
Gets this constructor's resource constructor type string.
|
private |
Loads connections between nodes (functioning as SignalTrackers) within a scene.
connectionList | A list of SimObjectAspect -> SimObjectAspect signal -> observer connections. |
localRoot | The root of the scene being constructed, relative to which scene paths are evaluated. |
|
private |
Loads the resources listed in the resource section of this scene description.
The resources used by this scene may have already been loaded by another scene, in which case they needn't be respecified here.
resourceList | List of Resource descriptions to load into the ResourceDatabase. |
|
private |
Loads the scene nodes listed in the "nodes" section of the scene description.
nodeList | A list of SimObjects, SceneNodes, and ViewportNodes, describing this scene. |
|
private |
(When used as a node in another scene) a list of overrides to SimObjectAspects to be applied to the root node of an imported scene.
node | A node that was created from a scene file and imported into the present scene. |
aspectList | A list of aspect overrides to be applied to the imported node. |
|
private |
(When used as a node in another scene) a list of overrides to ECSWorld components to be applied to the root node of an imported scene.
node | A node that was created from a scene file and imported into the present scene. |
componentList | A list of component overrides to be applied to the imported node. |