2004-07-27 23:00:53 +02:00
|
|
|
#ifndef _ps_World_H
|
|
|
|
#define _ps_World_H
|
|
|
|
|
2004-07-31 17:57:18 +02:00
|
|
|
#include "Terrain.h"
|
|
|
|
|
2004-07-27 23:00:53 +02:00
|
|
|
class CGame;
|
|
|
|
class CGameAttributes;
|
2005-09-30 02:59:42 +02:00
|
|
|
class CUnitManager;
|
|
|
|
class CEntityManager;
|
|
|
|
class CProjectileManager;
|
2005-10-09 05:43:03 +02:00
|
|
|
class CLOSManager;
|
2004-07-27 23:00:53 +02:00
|
|
|
|
|
|
|
class CWorld
|
|
|
|
{
|
|
|
|
CGame *m_pGame;
|
|
|
|
|
2004-08-05 15:07:51 +02:00
|
|
|
CTerrain m_Terrain;
|
2005-05-10 09:13:25 +02:00
|
|
|
// These all point to the respective g_* globals - the plan is to remove
|
2004-07-27 23:00:53 +02:00
|
|
|
// the globals and move them into CWorld members as soon as all code has
|
|
|
|
// been converted
|
2004-07-31 17:57:18 +02:00
|
|
|
CUnitManager &m_UnitManager;
|
2004-08-05 15:07:51 +02:00
|
|
|
CEntityManager &m_EntityManager;
|
2005-05-10 09:13:25 +02:00
|
|
|
CProjectileManager &m_ProjectileManager;
|
2005-10-09 05:43:03 +02:00
|
|
|
CLOSManager &m_LOSManager;
|
2005-03-22 03:17:55 +01:00
|
|
|
|
2004-07-27 23:00:53 +02:00
|
|
|
public:
|
2005-09-30 02:59:42 +02:00
|
|
|
CWorld(CGame *pGame);
|
2004-08-05 15:07:51 +02:00
|
|
|
~CWorld();
|
|
|
|
|
2005-03-22 03:17:55 +01:00
|
|
|
void RegisterInit(CGameAttributes *pGameAttributes);
|
2004-07-27 23:00:53 +02:00
|
|
|
/*
|
2005-03-22 03:17:55 +01:00
|
|
|
Initialize the World - load the map and all objects
|
2004-07-27 23:00:53 +02:00
|
|
|
*/
|
|
|
|
void Initialize(CGameAttributes *pGameAttributes);
|
2005-03-22 03:17:55 +01:00
|
|
|
|
2005-08-15 01:34:37 +02:00
|
|
|
// provided for JS _rewritemaps function
|
|
|
|
void RewriteMap();
|
2005-03-22 03:17:55 +01:00
|
|
|
|
2004-07-27 23:00:53 +02:00
|
|
|
inline CTerrain *GetTerrain()
|
2004-07-31 17:57:18 +02:00
|
|
|
{ return &m_Terrain; }
|
2004-07-27 23:00:53 +02:00
|
|
|
inline CUnitManager *GetUnitManager()
|
2004-07-31 17:57:18 +02:00
|
|
|
{ return &m_UnitManager; }
|
2005-10-09 05:43:03 +02:00
|
|
|
inline CEntityManager *GetEntityManager()
|
|
|
|
{ return &m_EntityManager; }
|
2005-05-10 09:13:25 +02:00
|
|
|
inline CProjectileManager *GetProjectileManager()
|
|
|
|
{ return &m_ProjectileManager; }
|
2005-10-09 05:43:03 +02:00
|
|
|
inline CLOSManager *GetLOSManager()
|
|
|
|
{ return &m_LOSManager; }
|
2005-08-09 17:55:44 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
// squelch "unable to generate" warnings
|
|
|
|
CWorld(const CWorld& rhs);
|
|
|
|
const CWorld& operator=(const CWorld& rhs);
|
2004-07-27 23:00:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#include "Game.h"
|
|
|
|
ERROR_SUBGROUP(Game, World);
|
|
|
|
ERROR_TYPE(Game_World, MapLoadFailed);
|
|
|
|
|
2005-08-15 01:34:37 +02:00
|
|
|
// rationale: see definition.
|
|
|
|
class CLightEnv;
|
|
|
|
extern CLightEnv g_LightEnv;
|
|
|
|
|
2004-07-27 23:00:53 +02:00
|
|
|
#endif
|