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.

105 lines
2.5 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: The worldspawn entity. This spawns first when each level begins.
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef WORLD_H
  8. #define WORLD_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. enum
  13. {
  14. TIME_MIDNIGHT = 0,
  15. TIME_DAWN,
  16. TIME_MORNING,
  17. TIME_AFTERNOON,
  18. TIME_DUSK,
  19. TIME_EVENING,
  20. };
  21. class CWorld : public CBaseEntity
  22. {
  23. public:
  24. DECLARE_CLASS( CWorld, CBaseEntity );
  25. CWorld();
  26. ~CWorld();
  27. DECLARE_SERVERCLASS();
  28. virtual int RequiredEdictIndex( void ) { return 0; } // the world always needs to be in slot 0
  29. static void RegisterSharedActivities( void );
  30. static void RegisterSharedEvents( void );
  31. virtual void Spawn( void );
  32. virtual void Precache( void );
  33. virtual void UpdateOnRemove( void );
  34. virtual bool KeyValue( const char *szKeyName, const char *szValue );
  35. virtual void DecalTrace( trace_t *pTrace, char const *decalName );
  36. virtual void VPhysicsCollision( int index, gamevcollisionevent_t *pEvent ) {}
  37. virtual void VPhysicsFriction( IPhysicsObject *pObject, float energy, int surfaceProps, int surfacePropsHit ) {}
  38. inline void GetWorldBounds( Vector &vecMins, Vector &vecMaxs )
  39. {
  40. VectorCopy( m_WorldMins, vecMins );
  41. VectorCopy( m_WorldMaxs, vecMaxs );
  42. }
  43. inline float GetWaveHeight() const
  44. {
  45. return (float)m_flWaveHeight;
  46. }
  47. bool GetDisplayTitle() const;
  48. bool GetStartDark() const;
  49. void SetDisplayTitle( bool display );
  50. void SetStartDark( bool startdark );
  51. int GetTimeOfDay() const;
  52. void SetTimeOfDay( int iTimeOfDay );
  53. bool IsColdWorld( void );
  54. int GetTimeOfDay() { return m_iTimeOfDay; }
  55. #ifdef PORTAL2
  56. virtual int Restore( IRestore &restore );
  57. int GetMaxBlobCount() const { return m_nMaxBlobCount; }
  58. #endif
  59. private:
  60. DECLARE_DATADESC();
  61. string_t m_iszChapterTitle;
  62. CNetworkVar( float, m_flWaveHeight );
  63. CNetworkVector( m_WorldMins );
  64. CNetworkVector( m_WorldMaxs );
  65. CNetworkVar( float, m_flMaxOccludeeArea );
  66. CNetworkVar( float, m_flMinOccluderArea );
  67. CNetworkVar( float, m_flMinPropScreenSpaceWidth );
  68. CNetworkVar( float, m_flMaxPropScreenSpaceWidth );
  69. CNetworkVar( string_t, m_iszDetailSpriteMaterial );
  70. // start flags
  71. CNetworkVar( bool, m_bStartDark );
  72. CNetworkVar( bool, m_bColdWorld );
  73. CNetworkVar( int, m_iTimeOfDay );
  74. bool m_bDisplayTitle;
  75. #ifdef PORTAL2
  76. CNetworkVar( int, m_nMaxBlobCount );
  77. #endif
  78. };
  79. CWorld* GetWorldEntity();
  80. extern const char *GetDefaultLightstyleString( int styleIndex );
  81. #endif // WORLD_H