diff options
Diffstat (limited to 'app/legion/worldmanager.h')
| -rw-r--r-- | app/legion/worldmanager.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/app/legion/worldmanager.h b/app/legion/worldmanager.h new file mode 100644 index 0000000..b1aa526 --- /dev/null +++ b/app/legion/worldmanager.h @@ -0,0 +1,84 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Contains all world state--the main game database +// +// $Revision: $ +// $NoKeywords: $ +//===========================================================================// + +#ifndef WORLDMANAGER_H +#define WORLDMANAGER_H + +#ifdef _WIN32 +#pragma once +#endif + +#include "gamemanager.h" +#include "mathlib/mathlib.h" +#include "tier1/convar.h" + + +//----------------------------------------------------------------------------- +// Forward declarations +//----------------------------------------------------------------------------- +class CHeightField; +class CCameraProperty; + + +//----------------------------------------------------------------------------- +// Entity types +//----------------------------------------------------------------------------- +class CPlayerEntity +{ +public: + CCameraProperty *m_pCameraProperty; +}; + + +//----------------------------------------------------------------------------- +// World state +//----------------------------------------------------------------------------- +class CWorldManager : public CGameManager<> +{ +public: + CWorldManager(); + virtual ~CWorldManager(); + + // Inherited from IGameManager + virtual LevelRetVal_t LevelInit( bool bFirstCall ); +// virtual void Update( ); + virtual LevelRetVal_t LevelShutdown( bool bFirstCall ); + + // Draws the world + void DrawWorld(); + + // Gets the local player + CPlayerEntity *GetLocalPlayer(); + +private: + CON_COMMAND_MEMBER_F( CWorldManager, "+forward", ForwardStart, "Start forward movement", 0 ); + CON_COMMAND_MEMBER_F( CWorldManager, "-forward", ForwardStop, "Stop forward movement", 0 ); + CON_COMMAND_MEMBER_F( CWorldManager, "+back", BackwardStart, "Start backward movement", 0 ); + CON_COMMAND_MEMBER_F( CWorldManager, "-back", BackwardStop, "Stop backward movement", 0 ); + + // Creates, destroys entities + void CreateEntities(); + void DestroyEntities(); + + // Sets the initial camera position + void SetInitialLocalPlayerPosition(); + + CHeightField *m_pHeightField; + + CPlayerEntity m_PlayerEntity; +}; + + +//----------------------------------------------------------------------------- +// Singleton accessor +//----------------------------------------------------------------------------- +extern CWorldManager *g_pWorldManager; + + +#endif // WORLDMANAGER_H + |