diff options
| author | Michael Sartain <[email protected]> | 2014-10-02 08:25:55 -0700 |
|---|---|---|
| committer | Michael Sartain <[email protected]> | 2014-10-02 08:25:55 -0700 |
| commit | 55ed12f8d1eb6887d348be03aee5573d44177ffb (patch) | |
| tree | 3686f7ca78c780cd9a3d367b79a9d9250c1be7c0 /mp/src/game/client/c_baseentity.h | |
| parent | * Added support for Visual C++ 2013 Express to VPC (diff) | |
| download | source-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.tar.xz source-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.zip | |
Updated the SDK with the latest code from the TF and HL2 branches.
Diffstat (limited to 'mp/src/game/client/c_baseentity.h')
| -rw-r--r-- | mp/src/game/client/c_baseentity.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/mp/src/game/client/c_baseentity.h b/mp/src/game/client/c_baseentity.h index c62b732f..f062760d 100644 --- a/mp/src/game/client/c_baseentity.h +++ b/mp/src/game/client/c_baseentity.h @@ -58,6 +58,7 @@ class C_BaseCombatCharacter; class CEntityMapData; class ConVar; class CDmgAccumulator; +class IHasAttributes; struct CSoundParameters; @@ -335,6 +336,7 @@ public: // save out interpolated values virtual void PreDataUpdate( DataUpdateType_t updateType ); virtual void PostDataUpdate( DataUpdateType_t updateType ); + virtual void OnDataUnchangedInPVS(); virtual void ValidateModelIndex( void ); @@ -516,6 +518,7 @@ public: // Used when the collision prop is told to ask game code for the world-space surrounding box virtual void ComputeWorldSpaceSurroundingBox( Vector *pVecWorldMins, Vector *pVecWorldMaxs ); + virtual float GetHealthBarHeightOffset() const { return 0.f; } // Returns the entity-to-world transform matrix3x4_t &EntityToWorldTransform(); @@ -686,7 +689,7 @@ public: virtual bool ShouldDraw(); inline bool IsVisible() const { return m_hRender != INVALID_CLIENT_RENDER_HANDLE; } - void UpdateVisibility(); + virtual void UpdateVisibility(); // Returns true if the entity changes its position every frame on the server but it doesn't // set animtime. In that case, the client returns true here so it copies the server time to @@ -743,7 +746,8 @@ public: virtual void SetHealth(int iHealth) {} virtual int GetHealth() const { return 0; } virtual int GetMaxHealth() const { return 1; } - virtual bool IsVisibleToTargetID( void ) { return false; } + virtual bool IsVisibleToTargetID( void ) const { return false; } + virtual bool IsHealthBarVisible( void ) const { return false; } // Returns the health fraction float HealthFraction() const; @@ -1172,7 +1176,17 @@ public: // Sets the origin + angles to match the last position received void MoveToLastReceivedPosition( bool force = false ); + // Return the IHasAttributes interface for this base entity. Removes the need for: + // dynamic_cast< IHasAttributes * >( pEntity ); + // Which is remarkably slow. + // GetAttribInterface( CBaseEntity *pEntity ) in attribute_manager.h uses + // this function, tests for NULL, and Asserts m_pAttributes == dynamic_cast. + inline IHasAttributes *GetHasAttributesInterfacePtr() const { return m_pAttributes; } + protected: + // NOTE: m_pAttributes needs to be set in the leaf class constructor. + IHasAttributes *m_pAttributes; + // Only meant to be called from subclasses void DestroyModelInstance(); |