Team Fortress 2 Source Code as on 22/4/2020
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

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Contains all world state--the main game database
  4. //
  5. // $Revision: $
  6. // $NoKeywords: $
  7. //===========================================================================//
  8. #ifndef WORLDMANAGER_H
  9. #define WORLDMANAGER_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "gamemanager.h"
  14. #include "mathlib/mathlib.h"
  15. #include "tier1/convar.h"
  16. //-----------------------------------------------------------------------------
  17. // Forward declarations
  18. //-----------------------------------------------------------------------------
  19. class CHeightField;
  20. class CCameraProperty;
  21. //-----------------------------------------------------------------------------
  22. // Entity types
  23. //-----------------------------------------------------------------------------
  24. class CPlayerEntity
  25. {
  26. public:
  27. CCameraProperty *m_pCameraProperty;
  28. };
  29. //-----------------------------------------------------------------------------
  30. // World state
  31. //-----------------------------------------------------------------------------
  32. class CWorldManager : public CGameManager<>
  33. {
  34. public:
  35. CWorldManager();
  36. virtual ~CWorldManager();
  37. // Inherited from IGameManager
  38. virtual LevelRetVal_t LevelInit( bool bFirstCall );
  39. // virtual void Update( );
  40. virtual LevelRetVal_t LevelShutdown( bool bFirstCall );
  41. // Draws the world
  42. void DrawWorld();
  43. // Gets the local player
  44. CPlayerEntity *GetLocalPlayer();
  45. private:
  46. CON_COMMAND_MEMBER_F( CWorldManager, "+forward", ForwardStart, "Start forward movement", 0 );
  47. CON_COMMAND_MEMBER_F( CWorldManager, "-forward", ForwardStop, "Stop forward movement", 0 );
  48. CON_COMMAND_MEMBER_F( CWorldManager, "+back", BackwardStart, "Start backward movement", 0 );
  49. CON_COMMAND_MEMBER_F( CWorldManager, "-back", BackwardStop, "Stop backward movement", 0 );
  50. // Creates, destroys entities
  51. void CreateEntities();
  52. void DestroyEntities();
  53. // Sets the initial camera position
  54. void SetInitialLocalPlayerPosition();
  55. CHeightField *m_pHeightField;
  56. CPlayerEntity m_PlayerEntity;
  57. };
  58. //-----------------------------------------------------------------------------
  59. // Singleton accessor
  60. //-----------------------------------------------------------------------------
  61. extern CWorldManager *g_pWorldManager;
  62. #endif // WORLDMANAGER_H