Modified source engine (2017) developed by valve and leaked in 2020. Not for commercial purporses
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

84 lines
2.3 KiB

//========= 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