summaryrefslogtreecommitdiff
path: root/app/legion/worldmanager.h
blob: b1aa526075b160f7dc6787754d213f7d40e433e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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