Ketchup Engine
Loading...
Searching...
No Matches
ModelManager Class Reference

#include <ModelManager.h>

Collaboration diagram for ModelManager:
Collaboration graph

Public Types

using MapKey = std::string
 
using StorageMap = std::unordered_map< MapKey, Model * >
 

Static Public Member Functions

static void Load (MapKey k, const char *path)
 Loads a Model from path and associates it with Key k.
 
static void Load (MapKey k, Model::PreMadeModels pm)
 Creates the Premade Model specified by pm and associates it with Key k.
 
static Model * Get (const MapKey k)
 Gets the Model associated with the given MapKey.
 

Static Public Attributes

static const MapKey spriteKey = "sprite"
 
static const MapKey unitBoxKey = "unit_box"
 
static const MapKey unitSphereKey = "unit_sphere"
 

Private Member Functions

 ModelManager ()
 
 ModelManager (const ModelManager &)=delete
 
ModelManageroperator= (const ModelManager &)=delete
 
 ~ModelManager ()
 
void privLoad (MapKey k, const char *path)
 
void privLoad (MapKey k, Model::PreMadeModels pm)
 

Static Private Member Functions

static ModelManagerInstance ()
 
static void Free ()
 

Private Attributes

StorageMap models
 

Static Private Attributes

static ModelManagerp_instance
 

Friends

class ModelManagerAttorney
 

Member Typedef Documentation

◆ MapKey

using ModelManager::MapKey = std::string

◆ StorageMap

using ModelManager::StorageMap = std::unordered_map<MapKey, Model*>

Constructor & Destructor Documentation

◆ ModelManager() [1/2]

ModelManager::ModelManager ( )
private

◆ ModelManager() [2/2]

ModelManager::ModelManager ( const ModelManager )
privatedelete

◆ ~ModelManager()

ModelManager::~ModelManager ( )
private

Member Function Documentation

◆ Free()

void ModelManager::Free ( )
staticprivate

◆ Get()

Model * ModelManager::Get ( const MapKey  k)
static

Gets the Model associated with the given MapKey.

Haru, 3/8/2023.

Parameters
kThe MapKey (string).
Returns
A pointer to the Model.

◆ Instance()

ModelManager * ModelManager::Instance ( )
staticprivate

◆ Load() [1/2]

void ModelManager::Load ( MapKey  k,
const char *  path 
)
static

Loads a Model from path and associates it with Key k.

Haru, 3/8/2023.

Parameters
kA MapKey (string) to associate the Model with.
pathPathname of the file.

◆ Load() [2/2]

void ModelManager::Load ( MapKey  k,
Model::PreMadeModels  pm 
)
static

Creates the Premade Model specified by pm and associates it with Key k.

Haru, 3/8/2023.

Parameters
kA MapKey (string) to associate the Model with.
pmThe Premade Model to generate.

◆ operator=()

ModelManager & ModelManager::operator= ( const ModelManager )
privatedelete

◆ privLoad() [1/2]

void ModelManager::privLoad ( MapKey  k,
const char *  path 
)
private

◆ privLoad() [2/2]

void ModelManager::privLoad ( MapKey  k,
Model::PreMadeModels  pm 
)
private

Friends And Related Function Documentation

◆ ModelManagerAttorney

friend class ModelManagerAttorney
friend

Member Data Documentation

◆ models

StorageMap ModelManager::models
private

◆ p_instance

ModelManager * ModelManager::p_instance
staticprivate

◆ spriteKey

const ModelManager::MapKey ModelManager::spriteKey = "sprite"
static

◆ unitBoxKey

const ModelManager::MapKey ModelManager::unitBoxKey = "unit_box"
static

◆ unitSphereKey

const ModelManager::MapKey ModelManager::unitSphereKey = "unit_sphere"
static

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