diff options
Diffstat (limited to 'mp/src/game/server/trigger_area_capture.h')
| -rw-r--r-- | mp/src/game/server/trigger_area_capture.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/mp/src/game/server/trigger_area_capture.h b/mp/src/game/server/trigger_area_capture.h index e2e494c9..383f3fad 100644 --- a/mp/src/game/server/trigger_area_capture.h +++ b/mp/src/game/server/trigger_area_capture.h @@ -32,9 +32,19 @@ class CTeamTrainWatcher; // Can either be capped by both teams at once, or just by one
// Time to capture and number of people required to capture are both passed by the mapper
//-----------------------------------------------------------------------------
-class CTriggerAreaCapture : public CBaseTrigger
+// This class is to get around the fact that DEFINE_FUNCTION doesn't like multiple inheritance
+class CTriggerAreaCaptureShim : public CBaseTrigger
{
- DECLARE_CLASS( CTriggerAreaCapture, CBaseTrigger );
+ virtual void AreaTouch( CBaseEntity *pOther ) = 0;
+public:
+ void Touch( CBaseEntity *pOther ) { return AreaTouch( pOther ) ; }
+};
+
+DECLARE_AUTO_LIST( ITriggerAreaCaptureAutoList );
+
+class CTriggerAreaCapture : public CTriggerAreaCaptureShim, public ITriggerAreaCaptureAutoList
+{
+ DECLARE_CLASS( CTriggerAreaCapture, CTriggerAreaCaptureShim );
public:
CTriggerAreaCapture();
@@ -73,10 +83,17 @@ public: void SetTrainWatcher( CTeamTrainWatcher *pTrainWatcher ){ m_hTrainWatcher = pTrainWatcher; } // used for train watchers that control train movement
CTeamTrainWatcher *GetTrainWatcher( void ) const { return m_hTrainWatcher; }
+ virtual void StartTouch(CBaseEntity *pOther) OVERRIDE;
+ virtual void EndTouch(CBaseEntity *pOther) OVERRIDE;
+
+ float GetCapTime() const { return m_flCapTime; }
+
+protected:
+
+ virtual bool CaptureModeScalesWithPlayers() const;
+
private:
- void StartTouch(CBaseEntity *pOther);
- void EXPORT AreaTouch( CBaseEntity *pOther );
- void EndTouch(CBaseEntity *pOther);
+ virtual void AreaTouch( CBaseEntity *pOther ) OVERRIDE;
void CaptureThink( void );
void StartCapture( int team, int capmode );
|