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.

80 lines
2.0 KiB

  1. //========= Copyright 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. class CWorld : public CBaseEntity
  13. {
  14. public:
  15. DECLARE_CLASS( CWorld, CBaseEntity );
  16. CWorld();
  17. ~CWorld();
  18. DECLARE_SERVERCLASS();
  19. virtual int RequiredEdictIndex( void ) { return 0; } // the world always needs to be in slot 0
  20. static void RegisterSharedActivities( void );
  21. static void RegisterSharedEvents( void );
  22. virtual void Spawn( void );
  23. virtual void Precache( void );
  24. virtual bool KeyValue( const char *szKeyName, const char *szValue );
  25. virtual void DecalTrace( trace_t *pTrace, char const *decalName );
  26. virtual void VPhysicsCollision( int index, gamevcollisionevent_t *pEvent ) {}
  27. virtual void VPhysicsFriction( IPhysicsObject *pObject, float energy, int surfaceProps, int surfacePropsHit ) {}
  28. inline void GetWorldBounds( Vector &vecMins, Vector &vecMaxs )
  29. {
  30. VectorCopy( m_WorldMins, vecMins );
  31. VectorCopy( m_WorldMaxs, vecMaxs );
  32. }
  33. inline float GetWaveHeight() const
  34. {
  35. return (float)m_flWaveHeight;
  36. }
  37. bool GetDisplayTitle() const;
  38. bool GetStartDark() const;
  39. void SetDisplayTitle( bool display );
  40. void SetStartDark( bool startdark );
  41. bool IsColdWorld( void );
  42. private:
  43. DECLARE_DATADESC();
  44. string_t m_iszChapterTitle;
  45. CNetworkVar( float, m_flWaveHeight );
  46. CNetworkVector( m_WorldMins );
  47. CNetworkVector( m_WorldMaxs );
  48. CNetworkVar( float, m_flMaxOccludeeArea );
  49. CNetworkVar( float, m_flMinOccluderArea );
  50. CNetworkVar( float, m_flMinPropScreenSpaceWidth );
  51. CNetworkVar( float, m_flMaxPropScreenSpaceWidth );
  52. CNetworkVar( string_t, m_iszDetailSpriteMaterial );
  53. // start flags
  54. CNetworkVar( bool, m_bStartDark );
  55. CNetworkVar( bool, m_bColdWorld );
  56. bool m_bDisplayTitle;
  57. };
  58. CWorld* GetWorldEntity();
  59. extern const char *GetDefaultLightstyleString( int styleIndex );
  60. #endif // WORLD_H