source-engine-2018-hl2_src/app/legion/worldmanager.h

85 lines
2.3 KiB
C
Raw Permalink Normal View History

2020-04-23 00:56:21 +08:00
//========= 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