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/econ/ihasattributes.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/econ/ihasattributes.h')
| -rw-r--r-- | game/shared/econ/ihasattributes.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/game/shared/econ/ihasattributes.h b/game/shared/econ/ihasattributes.h new file mode 100644 index 0000000..62b63e4 --- /dev/null +++ b/game/shared/econ/ihasattributes.h @@ -0,0 +1,46 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//============================================================================= + +#ifndef IHASATTRIBUTES_H +#define IHASATTRIBUTES_H +#ifdef _WIN32 +#pragma once +#endif + +//#include "attribute_manager.h" + +class CAttributeManager; +class CAttributeContainer; +class CBaseEntity; +class CAttributeList; + +// To allow an entity to have attributes, derive it from IHasAttributes and +// contain an CAttributeManager in it. Then: +// - Call InitializeAttributes() before your entity's Spawn() +// - Call AddAttribute() to add attributes to the entity +// - Call all the CAttributeManager hooks at the appropriate times in your entity. +// To get networking of the attributes to work on your entity: +// - Add this to your entity's send table: +// SendPropDataTable( SENDINFO_DT( m_AttributeManager ), &REFERENCE_SEND_TABLE(DT_AttributeManager) ), +// - Call this inside your entity's OnDataChanged(): +// GetAttributeManager()->OnDataChanged( updateType ); + +//----------------------------------------------------------------------------- +// Purpose: Derive from this if your entity wants to contain attributes. +//----------------------------------------------------------------------------- +class IHasAttributes +{ +public: + virtual CAttributeManager *GetAttributeManager( void ) = 0; + virtual CAttributeContainer *GetAttributeContainer( void ) = 0; + virtual CBaseEntity *GetAttributeOwner( void ) = 0; + virtual CAttributeList *GetAttributeList( void ) = 0; + + // Reapply yourself to whoever you should be providing attributes to. + virtual void ReapplyProvision( void ) = 0; +}; + +#endif // IHASATTRIBUTES_H |