Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/World.h
/* Copyright (C) 2013 Wildfire Games. | /* Copyright (C) 2017 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 21 Lines | |||||
#define ERROR_GROUP_GAME_DEFINED | #define ERROR_GROUP_GAME_DEFINED | ||||
ERROR_GROUP(Game); | ERROR_GROUP(Game); | ||||
#endif | #endif | ||||
ERROR_SUBGROUP(Game, World); | ERROR_SUBGROUP(Game, World); | ||||
ERROR_TYPE(Game_World, MapLoadFailed); | ERROR_TYPE(Game_World, MapLoadFailed); | ||||
class CGame; | class CGame; | ||||
class CUnitManager; | class CUnitManager; | ||||
class CTerritoryManager; | |||||
class CTerrain; | class CTerrain; | ||||
class CStrW; | class CStrW; | ||||
/** | /** | ||||
* CWorld is a general data class containing whatever is needed to accurately represent the world. | * 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. | * This includes the map, entities, influence maps, tiles, heightmap, etc. | ||||
**/ | **/ | ||||
class CWorld | class CWorld | ||||
{ | { | ||||
NONCOPYABLE(CWorld); | NONCOPYABLE(CWorld); | ||||
/** | /** | ||||
* pointer to the CGame object representing the game. | * pointer to the CGame object representing the game. | ||||
**/ | **/ | ||||
CGame *m_pGame; | CGame *m_pGame; | ||||
/** | /** | ||||
* pointer to the CTerrain object representing the height map. | * pointer to the CTerrain object representing the height map. | ||||
**/ | **/ | ||||
CTerrain *m_Terrain; | CTerrain *m_Terrain; | ||||
/** | /** | ||||
* pointer to the CUnitManager that holds all the units in the world. | * pointer to the CUnitManager that holds all the units in the world. | ||||
**/ | **/ | ||||
CUnitManager *m_UnitManager; | CUnitManager *m_UnitManager; | ||||
/** | |||||
* pointer to the CTerritoryManager that holds territory matrix for the world. | |||||
**/ | |||||
CTerritoryManager *m_TerritoryManager; | |||||
public: | public: | ||||
CWorld(CGame *pGame); | CWorld(CGame *pGame); | ||||
~CWorld(); | ~CWorld(); | ||||
/* | /* | ||||
Initialize the World - load the map and all objects | Initialize the World - load the map and all objects | ||||
*/ | */ | ||||
Show All 14 Lines | public: | ||||
/** | /** | ||||
* Get a reference to the unit manager object. | * Get a reference to the unit manager object. | ||||
* | * | ||||
* @return CUnitManager & dereferenced m_UnitManager. | * @return CUnitManager & dereferenced m_UnitManager. | ||||
**/ | **/ | ||||
inline CUnitManager &GetUnitManager() | inline CUnitManager &GetUnitManager() | ||||
{ return *m_UnitManager; } | { return *m_UnitManager; } | ||||
/** | |||||
* Get the pointer to the territory manager object. | |||||
* | |||||
* @return CTerritoryManager * the value of m_TerritoryManager. | |||||
**/ | |||||
inline CTerritoryManager *GetTerritoryManager() | |||||
{ return m_TerritoryManager; } | |||||
}; | }; | ||||
// rationale: see definition. | // rationale: see definition. | ||||
class CLightEnv; | class CLightEnv; | ||||
extern CLightEnv g_LightEnv; | extern CLightEnv g_LightEnv; | ||||
#endif | #endif |
Wildfire Games · Phabricator