SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
TerrainObjectManager Class Reference

Manages Terrain objects and their associated keys. More...

#include <TerrainObjectManager.h>

Static Public Member Functions

static TerrainGet (MapKey key)
 Retrieves a Terrain object by its key.
 
static void Load (MapKey key, Terrain *t)
 Loads a Terrain object directly.
 
static void Load (MapKey key, std::string heightmap, float sideLen, float maxH, float zeroAltitude, std::string tex, float uRep, float vRep)
 Loads a Terrain object from parameters.
 

Static Public Attributes

static const MapKey defaultTerrainKey = AssetDefaults::DefaultTerrainKey
 Default key for the default Terrain.
 

Private Member Functions

 TerrainObjectManager (const TerrainObjectManager &)=delete
 
TerrainObjectManageroperator= (const TerrainObjectManager &)=delete
 
void privDelete ()
 
TerrainprivGet (MapKey key)
 
void privLoad (MapKey key, Terrain *t)
 
void privLoad (MapKey key, std::string heightmap, float sideLen, float maxH, float zeroAltitude, std::string tex, float uRep, float vRep)
 

Static Private Member Functions

static TerrainObjectManagerInstance ()
 
static void Delete ()
 Deletes all managed Terrain objects and the singleton instance.
 

Private Attributes

std::map< MapKey, Terrain * > storageMap
 Map storing Terrain objects associated with their keys.
 

Static Private Attributes

static TerrainObjectManagerptrInstance = nullptr
 

Friends

class TerrainObjectManagerAttorney
 

Detailed Description

Manages Terrain objects and their associated keys.

The TerrainObjectManager is a singleton class responsible for loading, retrieving, and managing Terrain objects in the game engine. It uses a map to associate keys with Terrain objects, allowing for easy access and management of multiple terrains.

Member Function Documentation

◆ Get()

static Terrain * TerrainObjectManager::Get ( MapKey key)
inlinestatic

Retrieves a Terrain object by its key.

Parameters
keyThe key associated with the Terrain object.
Returns
A pointer to the Terrain object, or nullptr if the key is not found.
Here is the caller graph for this function:

◆ Load() [1/2]

static void TerrainObjectManager::Load ( MapKey key,
std::string heightmap,
float sideLen,
float maxH,
float zeroAltitude,
std::string tex,
float uRep,
float vRep )
inlinestatic

Loads a Terrain object from parameters.

Parameters
keyThe key to associate with the Terrain object.
heightmapThe heightmap file path.
sideLenThe side length of the terrain.
maxHThe maximum height of the terrain.
zeroAltitudeThe zero altitude of the terrain.
texThe texture file path.
uRepThe U texture repeat factor.
vRepThe V texture repeat factor.

◆ Load() [2/2]

static void TerrainObjectManager::Load ( MapKey key,
Terrain * t )
inlinestatic

Loads a Terrain object directly.

Parameters
keyThe key to associate with the Terrain object.
tA pointer to the Terrain object.

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