Counter Strike : Global Offensive Source Code
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.

86 lines
1.9 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #if !defined( C_WORLD_H )
  8. #define C_WORLD_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "c_baseentity.h"
  13. #if defined( CLIENT_DLL )
  14. #define CWorld C_World
  15. #endif
  16. class C_World : public C_BaseEntity
  17. {
  18. public:
  19. DECLARE_CLASS( C_World, C_BaseEntity );
  20. DECLARE_CLIENTCLASS();
  21. C_World( void );
  22. ~C_World( void );
  23. // Override the factory create/delete functions since the world is a singleton.
  24. virtual bool Init( int entnum, int iSerialNum );
  25. virtual void Release();
  26. virtual void Precache();
  27. virtual void Spawn();
  28. // Don't worry about adding the world to the collision list; it's already there
  29. virtual CollideType_t GetCollideType( void ) { return ENTITY_SHOULD_NOT_COLLIDE; }
  30. virtual void OnDataChanged( DataUpdateType_t updateType );
  31. virtual void PreDataUpdate( DataUpdateType_t updateType );
  32. float GetWaveHeight() const;
  33. const char *GetDetailSpriteMaterial() const;
  34. #ifdef PORTAL2
  35. int GetMaxBlobCount() const { return m_nMaxBlobCount; }
  36. #endif
  37. public:
  38. enum
  39. {
  40. MAX_DETAIL_SPRITE_MATERIAL_NAME_LENGTH = 256,
  41. };
  42. float m_flWaveHeight;
  43. Vector m_WorldMins;
  44. Vector m_WorldMaxs;
  45. bool m_bStartDark;
  46. float m_flMaxOccludeeArea;
  47. float m_flMinOccluderArea;
  48. float m_flMinPropScreenSpaceWidth;
  49. float m_flMaxPropScreenSpaceWidth;
  50. bool m_bColdWorld;
  51. int m_iTimeOfDay;
  52. private:
  53. char m_iszDetailSpriteMaterial[MAX_DETAIL_SPRITE_MATERIAL_NAME_LENGTH];
  54. #ifdef PORTAL2
  55. int m_nMaxBlobCount;
  56. #endif
  57. };
  58. inline float C_World::GetWaveHeight() const
  59. {
  60. return m_flWaveHeight;
  61. }
  62. inline const char *C_World::GetDetailSpriteMaterial() const
  63. {
  64. return m_iszDetailSpriteMaterial;
  65. }
  66. void ClientWorldFactoryInit();
  67. void ClientWorldFactoryShutdown();
  68. C_World* GetClientWorldEntity();
  69. #endif // C_WORLD_H