summaryrefslogtreecommitdiff
path: root/game/server/world.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/server/world.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/server/world.h')
-rw-r--r--game/server/world.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/game/server/world.h b/game/server/world.h
new file mode 100644
index 0000000..a8547d3
--- /dev/null
+++ b/game/server/world.h
@@ -0,0 +1,80 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: The worldspawn entity. This spawns first when each level begins.
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef WORLD_H
+#define WORLD_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+class CWorld : public CBaseEntity
+{
+public:
+ DECLARE_CLASS( CWorld, CBaseEntity );
+
+ CWorld();
+ ~CWorld();
+
+ DECLARE_SERVERCLASS();
+
+ virtual int RequiredEdictIndex( void ) { return 0; } // the world always needs to be in slot 0
+
+ static void RegisterSharedActivities( void );
+ static void RegisterSharedEvents( void );
+ virtual void Spawn( void );
+ virtual void Precache( void );
+ virtual bool KeyValue( const char *szKeyName, const char *szValue );
+ virtual void DecalTrace( trace_t *pTrace, char const *decalName );
+ virtual void VPhysicsCollision( int index, gamevcollisionevent_t *pEvent ) {}
+ virtual void VPhysicsFriction( IPhysicsObject *pObject, float energy, int surfaceProps, int surfacePropsHit ) {}
+
+ inline void GetWorldBounds( Vector &vecMins, Vector &vecMaxs )
+ {
+ VectorCopy( m_WorldMins, vecMins );
+ VectorCopy( m_WorldMaxs, vecMaxs );
+ }
+
+ inline float GetWaveHeight() const
+ {
+ return (float)m_flWaveHeight;
+ }
+
+ bool GetDisplayTitle() const;
+ bool GetStartDark() const;
+
+ void SetDisplayTitle( bool display );
+ void SetStartDark( bool startdark );
+
+ bool IsColdWorld( void );
+
+private:
+ DECLARE_DATADESC();
+
+ string_t m_iszChapterTitle;
+
+ CNetworkVar( float, m_flWaveHeight );
+ CNetworkVector( m_WorldMins );
+ CNetworkVector( m_WorldMaxs );
+ CNetworkVar( float, m_flMaxOccludeeArea );
+ CNetworkVar( float, m_flMinOccluderArea );
+ CNetworkVar( float, m_flMinPropScreenSpaceWidth );
+ CNetworkVar( float, m_flMaxPropScreenSpaceWidth );
+ CNetworkVar( string_t, m_iszDetailSpriteMaterial );
+
+ // start flags
+ CNetworkVar( bool, m_bStartDark );
+ CNetworkVar( bool, m_bColdWorld );
+ bool m_bDisplayTitle;
+};
+
+
+CWorld* GetWorldEntity();
+extern const char *GetDefaultLightstyleString( int styleIndex );
+
+
+#endif // WORLD_H