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
ToyMaker::IResourceFactory Class Referenceabstract

A class that holds references to all constructors for a type of Resource object. More...

#include <resource_database.hpp>

Inheritance diagram for ToyMaker::IResourceFactory:
ToyMaker::ResourceFactory< TResource >

Public Member Functions

virtual ~IResourceFactory ()=default
 Destroy the IResourceFactory object.
 
virtual std::shared_ptr< IResourcecreateResource (const nlohmann::json &resourceDescription)=0
 Creates a resource object of a specific type using its JSON resource description.
 

Protected Attributes

std::map< std::string, std::unique_ptr< IResourceConstructor > > mFactoryMethods {}
 A list of constructors that may be used to create a Resource of this kind.
 

Friends

class ResourceDatabase
 

Detailed Description

A class that holds references to all constructors for a type of Resource object.

Member Function Documentation

◆ createResource()

virtual std::shared_ptr< IResource > ToyMaker::IResourceFactory::createResource ( const nlohmann::json & resourceDescription)
pure virtual

Creates a resource object of a specific type using its JSON resource description.

Parameters
resourceDescriptionA description of the resource.
Returns
std::shared_ptr<IResource> A reference to the constructed resource.

Implemented in ToyMaker::ResourceFactory< TResource >.


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