janwas
a69ac0dee9
- add convenience macros for config_db(CFG_GET_SYS_VAL) - VFSUtil::EnumDirEnts now uses flags instead of bool recursive - UNUSED() for params, UNUSED2 (<- need better name) for variables - config.h defines must be tested with #if (always defined) -> allows detecting misspellings thanks to compiler warnings - replace debug_assert(0) with debug_warn (its sole purpose) - replace ScriptingHost::ValueToInt et al with ToPrimitive - use nommgr.h to disable both mmgr and VC debug heap This was SVN commit r2585.
60 lines
1.3 KiB
C++
Executable File
60 lines
1.3 KiB
C++
Executable File
#ifndef _ps_World_H
|
|
#define _ps_World_H
|
|
|
|
#include "Terrain.h"
|
|
#include "UnitManager.h"
|
|
#include "EntityManager.h"
|
|
#include "Projectile.h"
|
|
|
|
class CGame;
|
|
class CGameAttributes;
|
|
|
|
class CWorld
|
|
{
|
|
CGame *m_pGame;
|
|
|
|
CTerrain m_Terrain;
|
|
// These all point to the respective g_* globals - the plan is to remove
|
|
// the globals and move them into CWorld members as soon as all code has
|
|
// been converted
|
|
CUnitManager &m_UnitManager;
|
|
CEntityManager &m_EntityManager;
|
|
CProjectileManager &m_ProjectileManager;
|
|
|
|
public:
|
|
inline CWorld(CGame *pGame):
|
|
m_pGame(pGame),
|
|
m_Terrain(),
|
|
m_UnitManager(g_UnitMan),
|
|
m_EntityManager(*(new CEntityManager())),
|
|
m_ProjectileManager( *(new CProjectileManager()))
|
|
{}
|
|
|
|
~CWorld();
|
|
|
|
void RegisterInit(CGameAttributes *pGameAttributes);
|
|
/*
|
|
Initialize the World - load the map and all objects
|
|
*/
|
|
void Initialize(CGameAttributes *pGameAttributes);
|
|
|
|
|
|
inline CTerrain *GetTerrain()
|
|
{ return &m_Terrain; }
|
|
inline CUnitManager *GetUnitManager()
|
|
{ return &m_UnitManager; }
|
|
inline CProjectileManager *GetProjectileManager()
|
|
{ return &m_ProjectileManager; }
|
|
|
|
private:
|
|
// squelch "unable to generate" warnings
|
|
CWorld(const CWorld& rhs);
|
|
const CWorld& operator=(const CWorld& rhs);
|
|
};
|
|
|
|
#include "Game.h"
|
|
ERROR_SUBGROUP(Game, World);
|
|
ERROR_TYPE(Game_World, MapLoadFailed);
|
|
|
|
#endif
|