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
NineSlicePanelFromDescription Class Reference

Resource constructor for creating new NineSlicePanel resources from their descriptions in JSON. More...

#include <nine_slice_panel.hpp>

Inheritance diagram for NineSlicePanelFromDescription:
ToyMaker::ResourceConstructor< NineSlicePanel, NineSlicePanelFromDescription > ToyMaker::IResourceConstructor

Public Member Functions

 NineSlicePanelFromDescription ()
 creates an instance of this constructor.
 
- Public Member Functions inherited from ToyMaker::ResourceConstructor< NineSlicePanel, NineSlicePanelFromDescription >
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.)
 

Static Public Member Functions

static std::string getResourceConstructorName ()
 Gets the resource constructor type string associated with this class.
 

Private Member Functions

std::shared_ptr< ToyMaker::IResourcecreateResource (const nlohmann::json &methodParameters) override
 Creates a NineSlicePanel resource from its JSON description.
 

Additional Inherited Members

- Protected Member Functions inherited from ToyMaker::ResourceConstructor< NineSlicePanel, NineSlicePanelFromDescription >
 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

Resource constructor for creating new NineSlicePanel resources from their descriptions in JSON.

Its appearance in JSON is as follows:

{
"name": "Bad_Panel",
"type": "NineSlicePanel",
"method": "fromDescription",
"parameters": {
"base_texture": "Bad_Panel_Texture",
"content_region": [ 0.0235, 0.0235, 0.953, 0.953]
}
}

Member Function Documentation

◆ createResource()

std::shared_ptr< ToyMaker::IResource > NineSlicePanelFromDescription::createResource ( const nlohmann::json & methodParameters)
overrideprivatevirtual

Creates a NineSlicePanel resource from its JSON description.

Parameters
methodParametersThe description of the NineSlicePanel, in JSON.
Returns
std::shared_ptr<ToyMaker::IResource> A base pointer to the NineSlicePanel object's base resource class instance.

Implements ToyMaker::IResourceConstructor.

◆ getResourceConstructorName()

static std::string NineSlicePanelFromDescription::getResourceConstructorName ( )
inlinestatic

Gets the resource constructor type string associated with this class.

Returns
std::string The resource constructor type string associated with this class.

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