source-sdk-2013-mapbase/sp/src/game/server/world.h
2021-01-27 11:01:38 -06:00

108 lines
2.7 KiB
C++

//========= 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 );
#ifdef MAPBASE
inline const char *GetChapterTitle()
{
return STRING(m_iszChapterTitle.Get());
}
void InputSetChapterTitle( inputdata_t &inputdata );
#endif
#ifdef MAPBASE_VSCRIPT
ScriptLanguage_t GetScriptLanguage() { return (ScriptLanguage_t)(m_iScriptLanguage); }
#endif
private:
DECLARE_DATADESC();
#ifdef MAPBASE
// Now needs to show up on the client for RPC
CNetworkVar( string_t, m_iszChapterTitle );
// Suppresses m_iszChapterTitle's env_message creation,
// allowing it to only be used for saves and RPC
bool m_bChapterTitleNoMessage;
#else
string_t m_iszChapterTitle;
#endif
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 );
#ifdef MAPBASE_VSCRIPT
int m_iScriptLanguage;
//CNetworkVar( int, m_iScriptLanguageClient ); // Now entirely on client
#endif
// start flags
CNetworkVar( bool, m_bStartDark );
CNetworkVar( bool, m_bColdWorld );
bool m_bDisplayTitle;
};
CWorld* GetWorldEntity();
extern const char *GetDefaultLightstyleString( int styleIndex );
#endif // WORLD_H