aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/client/c_basetempentity.h
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /mp/src/game/client/c_basetempentity.h
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/game/client/c_basetempentity.h')
-rw-r--r--mp/src/game/client/c_basetempentity.h121
1 files changed, 121 insertions, 0 deletions
diff --git a/mp/src/game/client/c_basetempentity.h b/mp/src/game/client/c_basetempentity.h
new file mode 100644
index 00000000..ffc742af
--- /dev/null
+++ b/mp/src/game/client/c_basetempentity.h
@@ -0,0 +1,121 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef C_BASETEMPENTITY_H
+#define C_BASETEMPENTITY_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include "client_class.h"
+#include "iclientnetworkable.h"
+#include "c_recipientfilter.h"
+
+
+//-----------------------------------------------------------------------------
+// Purpose: Base class for TEs. All TEs should derive from this and at
+// least implement OnDataChanged to be notified when the TE has been received
+// from the server
+//-----------------------------------------------------------------------------
+class C_BaseTempEntity : public IClientUnknown, public IClientNetworkable
+
+{
+public:
+ DECLARE_CLASS_NOBASE( C_BaseTempEntity );
+ DECLARE_CLIENTCLASS();
+
+ C_BaseTempEntity( void );
+ virtual ~C_BaseTempEntity( void );
+
+
+// IClientUnknown implementation.
+public:
+
+ virtual void SetRefEHandle( const CBaseHandle &handle ) { Assert( false ); }
+ virtual const CBaseHandle& GetRefEHandle() const { return *((CBaseHandle*)0); }
+
+ virtual IClientUnknown* GetIClientUnknown() { return this; }
+ virtual ICollideable* GetCollideable() { return 0; }
+ virtual IClientNetworkable* GetClientNetworkable() { return this; }
+ virtual IClientRenderable* GetClientRenderable() { return 0; }
+ virtual IClientEntity* GetIClientEntity() { return 0; }
+ virtual C_BaseEntity* GetBaseEntity() { return 0; }
+ virtual IClientThinkable* GetClientThinkable() { return 0; }
+
+
+// IClientNetworkable overrides.
+public:
+
+ virtual void Release();
+ virtual void NotifyShouldTransmit( ShouldTransmitState_t state );
+ virtual void PreDataUpdate( DataUpdateType_t updateType );
+ virtual void PostDataUpdate( DataUpdateType_t updateType );
+ virtual void OnPreDataChanged( DataUpdateType_t updateType );
+ virtual void OnDataChanged( DataUpdateType_t updateType );
+ virtual void SetDormant( bool bDormant );
+ virtual bool IsDormant( void );
+ virtual int entindex( void ) const;
+ virtual void ReceiveMessage( int classID, bf_read &msg );
+ virtual void* GetDataTableBasePtr();
+ virtual void SetDestroyedOnRecreateEntities( void );
+
+public:
+
+ // Dummy for CNetworkVars.
+ void NetworkStateChanged() {}
+ void NetworkStateChanged( void *pVar ) {}
+
+ virtual bool Init(int entnum, int iSerialNum);
+
+ virtual void Precache( void );
+
+ // For dynamic entities, return true to allow destruction
+ virtual bool ShouldDestroy( void ) { return false; };
+
+ C_BaseTempEntity *GetNext( void );
+
+ // Get list of tempentities
+ static C_BaseTempEntity *GetList( void );
+
+ C_BaseTempEntity *GetNextDynamic( void );
+
+ // Determine the color modulation amount
+ void GetColorModulation( float* color )
+ {
+ assert(color);
+ color[0] = color[1] = color[2] = 1.0f;
+ }
+
+ // Should this object be able to have shadows cast onto it?
+ virtual bool ShouldReceiveProjectedTextures( int flags ) { return false; }
+
+// Static members
+public:
+ // List of dynamically allocated temp entis
+ static C_BaseTempEntity *GetDynamicList();
+
+ // Called at startup to allow temp entities to precache any models/sounds that they need
+ static void PrecacheTempEnts( void );
+
+ static void ClearDynamicTempEnts( void );
+
+ static void CheckDynamicTempEnts( void );
+
+private:
+
+ // Next in chain
+ C_BaseTempEntity *m_pNext;
+ C_BaseTempEntity *m_pNextDynamic;
+
+ // TEs add themselves to this list for the executable.
+ static C_BaseTempEntity *s_pTempEntities;
+ static C_BaseTempEntity *s_pDynamicEntities;
+};
+
+
+#endif // C_BASETEMPENTITY_H