diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /sp/src/public/tier1/convar_serverbounded.h | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'sp/src/public/tier1/convar_serverbounded.h')
| -rw-r--r-- | sp/src/public/tier1/convar_serverbounded.h | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/sp/src/public/tier1/convar_serverbounded.h b/sp/src/public/tier1/convar_serverbounded.h index 59287ec6..3bdd1ab3 100644 --- a/sp/src/public/tier1/convar_serverbounded.h +++ b/sp/src/public/tier1/convar_serverbounded.h @@ -1,53 +1,53 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose: Helper class for cvars that have restrictions on their value.
-//
-//=============================================================================//
-
-#ifndef CONVAR_SERVERBOUNDED_H
-#define CONVAR_SERVERBOUNDED_H
-#ifdef _WIN32
-#pragma once
-#endif
-
-
-// This class is used to virtualize a ConVar's value, so the client can restrict its
-// value while connected to a server. When using this across modules, it's important
-// to dynamic_cast it to a ConVar_ServerBounded or you won't get the restricted value.
-//
-// NOTE: FCVAR_USERINFO vars are not virtualized before they are sent to the server
-// (we have no way to detect if the virtualized value would change), so
-// if you want to use a bounded cvar's value on the server, you must rebound it
-// the same way the client does.
-class ConVar_ServerBounded : public ConVar
-{
-public:
- ConVar_ServerBounded( char const *pName, char const *pDefaultValue, int flags, char const *pHelpString )
- : ConVar( pName, pDefaultValue, flags, pHelpString )
- {
- }
-
- ConVar_ServerBounded( char const *pName, char const *pDefaultValue, int flags, char const *pHelpString, FnChangeCallback_t callback )
- : ConVar( pName, pDefaultValue, flags, pHelpString, callback )
- {
- }
-
- ConVar_ServerBounded( char const *pName, char const *pDefaultValue, int flags, char const *pHelpString, bool bMin, float fMin, bool bMax, float fMax )
- : ConVar( pName, pDefaultValue, flags, pHelpString, bMin, fMin, bMax, fMax ) {}
-
- // You must implement GetFloat.
- virtual float GetFloat() const = 0;
-
- // You can optionally implement these.
- virtual int GetInt() const { return (int)GetFloat(); }
- virtual bool GetBool() const { return ( GetInt() != 0 ); }
-
- // Use this to get the underlying cvar's value.
- float GetBaseFloatValue() const
- {
- return ConVar::GetFloat();
- }
-};
-
-
-#endif // CONVAR_SERVERBOUNDED_H
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Helper class for cvars that have restrictions on their value. +// +//=============================================================================// + +#ifndef CONVAR_SERVERBOUNDED_H +#define CONVAR_SERVERBOUNDED_H +#ifdef _WIN32 +#pragma once +#endif + + +// This class is used to virtualize a ConVar's value, so the client can restrict its +// value while connected to a server. When using this across modules, it's important +// to dynamic_cast it to a ConVar_ServerBounded or you won't get the restricted value. +// +// NOTE: FCVAR_USERINFO vars are not virtualized before they are sent to the server +// (we have no way to detect if the virtualized value would change), so +// if you want to use a bounded cvar's value on the server, you must rebound it +// the same way the client does. +class ConVar_ServerBounded : public ConVar +{ +public: + ConVar_ServerBounded( char const *pName, char const *pDefaultValue, int flags, char const *pHelpString ) + : ConVar( pName, pDefaultValue, flags, pHelpString ) + { + } + + ConVar_ServerBounded( char const *pName, char const *pDefaultValue, int flags, char const *pHelpString, FnChangeCallback_t callback ) + : ConVar( pName, pDefaultValue, flags, pHelpString, callback ) + { + } + + ConVar_ServerBounded( char const *pName, char const *pDefaultValue, int flags, char const *pHelpString, bool bMin, float fMin, bool bMax, float fMax ) + : ConVar( pName, pDefaultValue, flags, pHelpString, bMin, fMin, bMax, fMax ) {} + + // You must implement GetFloat. + virtual float GetFloat() const = 0; + + // You can optionally implement these. + virtual int GetInt() const { return (int)GetFloat(); } + virtual bool GetBool() const { return ( GetInt() != 0 ); } + + // Use this to get the underlying cvar's value. + float GetBaseFloatValue() const + { + return ConVar::GetFloat(); + } +}; + + +#endif // CONVAR_SERVERBOUNDED_H |