Sly Engine
TerrainObjectManager Class Reference

#include <TerrainObjectManager.h>

Collaboration diagram for TerrainObjectManager:
Collaboration graph

Static Public Member Functions

static void Load (std::string key, const char *OSpath, std::string TextureKey, float sideLength, float maxHeight, int repeatU, int repeatV)
 Call to load the heightmap and create a terrainObject that will be stored internally. More...
 
static TerrainObjectGet (std::string key)
 Gets a terrain object* using the given key. More...
 

Private Types

typedef std::string MapKey
 Defines an alias representing the map key associated with the object. More...
 
typedef std::map< MapKey, TerrainObject * > StorageMap
 Defines an alias representing the storage map. More...
 

Private Member Functions

 TerrainObjectManager ()
 Default constructor. More...
 
 TerrainObjectManager (const TerrainObjectManager &)=delete
 Copy constructor. More...
 
 TerrainObjectManager (TerrainObjectManager &&)=delete
 Move constructor. More...
 
TerrainObjectManageroperator= (const TerrainObjectManager &)=delete
 Assignment operator. More...
 
TerrainObjectManageroperator= (TerrainObjectManager &&)=delete
 Move assignment operator. More...
 
 ~TerrainObjectManager ()=default
 Deconstructor. More...
 
void privDelete ()
 Internal call to delete pointer instance. Only to be called by the engine. More...
 
TerrainObjectprivGet (std::string key)
 Internal call to get the requested terrain object from the terrainObjectMap. More...
 
void privLoad (std::string key, const char *OSpath, std::string TextureKey, float sideLength, float maxHeight, int repeatU, int repeatV)
 Internal call to load the heightmap and create a terrainObject that will be stored internally. More...
 

Static Private Member Functions

static TerrainObjectManagerInstance ()
 Gets the instance of TerrainObjectManager (Singleton) More...
 
static void Delete ()
 Sly's hook into the delete section of the TerrainObjectManager. Only called within Sly. More...
 

Private Attributes

std::string defaultPath
 The default path for the Heightmap. More...
 
StorageMap terrainObjectMap
 The map containing all terrain objects by MapKey. More...
 

Static Private Attributes

static TerrainObjectManagerptrInstance = nullptr
 Pointer to a single TerrainObject Instane. More...
 

Friends

class TerrainObjectManagerAttorney
 

Member Typedef Documentation

◆ MapKey

std::string TerrainObjectManager::MapKey
private

Defines an alias representing the map key associated with the object.

◆ StorageMap

Defines an alias representing the storage map.

Constructor & Destructor Documentation

◆ TerrainObjectManager() [1/3]

TerrainObjectManager::TerrainObjectManager ( )
private

Default constructor.

Here is the caller graph for this function:

◆ TerrainObjectManager() [2/3]

TerrainObjectManager::TerrainObjectManager ( const TerrainObjectManager )
privatedelete

Copy constructor.

◆ TerrainObjectManager() [3/3]

TerrainObjectManager::TerrainObjectManager ( TerrainObjectManager &&  )
privatedelete

Move constructor.

◆ ~TerrainObjectManager()

TerrainObjectManager::~TerrainObjectManager ( )
privatedefault

Deconstructor.

Member Function Documentation

◆ Delete()

static void TerrainObjectManager::Delete ( )
inlinestaticprivate

Sly's hook into the delete section of the TerrainObjectManager. Only called within Sly.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get()

static TerrainObject * TerrainObjectManager::Get ( std::string  key)
inlinestatic

Gets a terrain object* using the given key.

Parameters
keyThe key to find the associated terrain object.
Returns
Null if it fails, else a pointer to a TerrainObject.
Here is the call graph for this function:

◆ Instance()

static TerrainObjectManager & TerrainObjectManager::Instance ( )
inlinestaticprivate

Gets the instance of TerrainObjectManager (Singleton)

Returns
A reference to a TerrainObjectManager.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Load()

static void TerrainObjectManager::Load ( std::string  key,
const char *  OSpath,
std::string  TextureKey,
float  sideLength,
float  maxHeight,
int  repeatU,
int  repeatV 
)
inlinestatic

Call to load the heightmap and create a terrainObject that will be stored internally.

Parameters
keyThe key to associate the newly stored terrain object.
OSpathFull pathname to the specified heightmap (note, DefaultPath is appended to the beginning).
TextureKeyThe key to a texture stored within the TextureManager to place on the heightmap
sideLengthLength of the side.
maxHeightThe maximum height.
repeatUThe repeat u.
repeatVThe repeat v.
Here is the call graph for this function:

◆ operator=() [1/2]

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

Assignment operator.

◆ operator=() [2/2]

TerrainObjectManager& TerrainObjectManager::operator= ( TerrainObjectManager &&  )
privatedelete

Move assignment operator.

◆ privDelete()

void TerrainObjectManager::privDelete ( )
private

Internal call to delete pointer instance. Only to be called by the engine.

Here is the caller graph for this function:

◆ privGet()

TerrainObject * TerrainObjectManager::privGet ( std::string  key)
private

Internal call to get the requested terrain object from the terrainObjectMap.

Parameters
keyThe key associated with the stored map
Returns
Null if it fails, else a pointer to a TerrainObject.
Here is the caller graph for this function:

◆ privLoad()

void TerrainObjectManager::privLoad ( std::string  key,
const char *  OSpath,
std::string  TextureKey,
float  sideLength,
float  maxHeight,
int  repeatU,
int  repeatV 
)
private

Internal call to load the heightmap and create a terrainObject that will be stored internally.

Parameters
keyThe key to associate the newly stored terrain object.
OSpathFull pathname to the specified heightmap (note, DefaultPath is appended to the beginning).
TextureKeyA key to a texture that has already been stored within the TextureManager.
sideLengthLength of the side.
maxHeightThe maximum height.
repeatUThe repeat u.
repeatVThe repeat v.
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ TerrainObjectManagerAttorney

friend class TerrainObjectManagerAttorney
friend

Member Data Documentation

◆ defaultPath

std::string TerrainObjectManager::defaultPath
private

The default path for the Heightmap.

◆ ptrInstance

TerrainObjectManager * TerrainObjectManager::ptrInstance = nullptr
staticprivate

Pointer to a single TerrainObject Instane.

◆ terrainObjectMap

StorageMap TerrainObjectManager::terrainObjectMap
private

The map containing all terrain objects by MapKey.


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