Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
|
Tracks pointers to all ResourceConstructors responsible for creating a resource of one type. More...
#include <resource_database.hpp>
Public Member Functions | |
ResourceFactory () | |
Construct a new Resource Factory object. | |
![]() | |
virtual | ~IResourceFactory ()=default |
Destroy the IResourceFactory object. | |
Private Member Functions | |
std::shared_ptr< IResource > | createResource (const nlohmann::json &resourceDescription) override |
Create an object of type Resource, specifying its constructor and the constructor's parameters in JSON. | |
Additional Inherited Members | |
![]() | |
std::map< std::string, std::unique_ptr< IResourceConstructor > > | mFactoryMethods {} |
A list of constructors that may be used to create a Resource of this kind. | |
Tracks pointers to all ResourceConstructors responsible for creating a resource of one type.
An object of this kind is created automatically when a resource type registers itself for management by the ResourceDatabase.
TResource | The resource this factory can create. |
|
overrideprivatevirtual |
Create an object of type Resource, specifying its constructor and the constructor's parameters in JSON.
resourceDescription | A JSON description containing the resource constructor's name and parameters. |
Implements ToyMaker::IResourceFactory.