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"
|
|
|
|
#include "UnitManager.h"
|
2004-08-05 15:07:51 +02:00
|
|
|
#include "EntityManager.h"
|
2005-05-10 09:13:25 +02:00
|
|
|
#include "Projectile.h"
|
2004-07-31 17:57:18 +02:00
|
|
|
|
2004-07-27 23:00:53 +02:00
|
|
|
class CGame;
|
|
|
|
class CGameAttributes;
|
|
|
|
|
|
|
|
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-03-22 03:17:55 +01:00
|
|
|
|
2004-07-27 23:00:53 +02:00
|
|
|
public:
|
|
|
|
inline CWorld(CGame *pGame):
|
|
|
|
m_pGame(pGame),
|
2004-07-31 17:57:18 +02:00
|
|
|
m_Terrain(),
|
2004-08-05 15:07:51 +02:00
|
|
|
m_UnitManager(g_UnitMan),
|
2005-05-10 09:13:25 +02:00
|
|
|
m_EntityManager(*(new CEntityManager())),
|
|
|
|
m_ProjectileManager( *(new CProjectileManager()))
|
2004-07-27 23:00:53 +02:00
|
|
|
{}
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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-05-10 09:13:25 +02:00
|
|
|
inline CProjectileManager *GetProjectileManager()
|
|
|
|
{ return &m_ProjectileManager; }
|
2004-07-27 23:00:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#include "Game.h"
|
|
|
|
ERROR_SUBGROUP(Game, World);
|
|
|
|
ERROR_TYPE(Game_World, MapLoadFailed);
|
|
|
|
|
|
|
|
#endif
|