diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/saverestore_utlclass.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/saverestore_utlclass.h')
| -rw-r--r-- | game/shared/saverestore_utlclass.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/game/shared/saverestore_utlclass.h b/game/shared/saverestore_utlclass.h new file mode 100644 index 0000000..ed38b68 --- /dev/null +++ b/game/shared/saverestore_utlclass.h @@ -0,0 +1,66 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#ifndef SAVERESTORE_UTLCLASS_H +#define SAVERESTORE_UTLCLASS_H + +#if defined( _WIN32 ) +#pragma once +#endif + +//------------------------------------- + +template <int FIELD_TYPE> +class CTypedescDeducer +{ +public: + template <class UTLCLASS> + static datamap_t *Deduce( UTLCLASS *p ) + { + return NULL; + } + +}; + +template<> +class CTypedescDeducer<FIELD_EMBEDDED> +{ +public: + template <class UTLCLASS> + static datamap_t *Deduce( UTLCLASS *p ) + { + return &UTLCLASS::ElemType_t::m_DataMap; + } + +}; + +#define UTLCLASS_SAVERESTORE_VALIDATE_TYPE( type ) \ + COMPILE_TIME_ASSERT( \ + type == FIELD_FLOAT ||\ + type == FIELD_STRING ||\ + type == FIELD_CLASSPTR ||\ + type == FIELD_EHANDLE ||\ + type == FIELD_EDICT ||\ + type == FIELD_VECTOR ||\ + type == FIELD_QUATERNION ||\ + type == FIELD_POSITION_VECTOR ||\ + type == FIELD_INTEGER ||\ + type == FIELD_BOOLEAN ||\ + type == FIELD_SHORT ||\ + type == FIELD_CHARACTER ||\ + type == FIELD_TIME ||\ + type == FIELD_TICK ||\ + type == FIELD_MODELNAME ||\ + type == FIELD_SOUNDNAME ||\ + type == FIELD_COLOR32 ||\ + type == FIELD_EMBEDDED ||\ + type == FIELD_MODELINDEX ||\ + type == FIELD_MATERIALINDEX\ + ) + +//------------------------------------- + +#endif // SAVERESTORE_UTLCLASS_H |