Pyrogenesis trunk
Public Member Functions | Private Attributes | List of all members
CWorld Class Reference

CWorld is a general data class containing whatever is needed to accurately represent the world. More...

#include <World.h>

Collaboration diagram for CWorld:
Collaboration graph
[legend]

Public Member Functions

 CWorld (CGame &game)
 Constructor. More...
 
 ~CWorld ()
 
void RegisterInit (const CStrW &mapFile, const ScriptContext &cx, JS::HandleValue settings, int playerID)
 Initializes the game world with the attributes provided. More...
 
void RegisterInitRMS (const CStrW &scriptFile, const ScriptContext &cx, JS::HandleValue settings, int playerID)
 
int DeleteMapReader ()
 Explicitly delete m_MapReader once the map has finished loading. More...
 
CTerrainGetTerrain ()
 Get a reference to the terrain object. More...
 
CUnitManagerGetUnitManager ()
 Get a reference to the unit manager object. More...
 

Private Attributes

CGamem_Game
 Reference to the CGame object representing the game. More...
 
const std::unique_ptr< CTerrainm_Terrain
 The CTerrain object represents the height map. More...
 
const std::unique_ptr< CUnitManagerm_UnitManager
 The CUnitManager that holds all the units in the world. More...
 
std::unique_ptr< CMapReaderm_MapReader
 The map reader gets deleted just after the map is read. More...
 

Detailed Description

CWorld is a general data class containing whatever is needed to accurately represent the world.

This includes the map, entities, influence maps, tiles, heightmap, etc.

Constructor & Destructor Documentation

◆ CWorld()

CWorld::CWorld ( CGame game)

Constructor.

Parameters
gameCGame& game reference to the container game object.

◆ ~CWorld()

CWorld::~CWorld ( )
default

Member Function Documentation

◆ DeleteMapReader()

int CWorld::DeleteMapReader ( )

Explicitly delete m_MapReader once the map has finished loading.

◆ GetTerrain()

CTerrain & CWorld::GetTerrain ( )
inline

Get a reference to the terrain object.

Returns
CTerrain& dereferenced m_Terrain.

◆ GetUnitManager()

CUnitManager & CWorld::GetUnitManager ( )
inline

Get a reference to the unit manager object.

Returns
CUnitManager& dereferenced m_UnitManager.

◆ RegisterInit()

void CWorld::RegisterInit ( const CStrW &  mapFile,
const ScriptContext cx,
JS::HandleValue  settings,
int  playerID 
)

Initializes the game world with the attributes provided.

◆ RegisterInitRMS()

void CWorld::RegisterInitRMS ( const CStrW &  scriptFile,
const ScriptContext cx,
JS::HandleValue  settings,
int  playerID 
)

Member Data Documentation

◆ m_Game

CGame& CWorld::m_Game
private

Reference to the CGame object representing the game.

◆ m_MapReader

std::unique_ptr<CMapReader> CWorld::m_MapReader
private

The map reader gets deleted just after the map is read.

◆ m_Terrain

const std::unique_ptr<CTerrain> CWorld::m_Terrain
private

The CTerrain object represents the height map.

◆ m_UnitManager

const std::unique_ptr<CUnitManager> CWorld::m_UnitManager
private

The CUnitManager that holds all the units in the world.


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