summaryrefslogtreecommitdiff
path: root/game/server/team_control_point_round.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/server/team_control_point_round.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/server/team_control_point_round.h')
-rw-r--r--game/server/team_control_point_round.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/game/server/team_control_point_round.h b/game/server/team_control_point_round.h
new file mode 100644
index 0000000..a642ca3
--- /dev/null
+++ b/game/server/team_control_point_round.h
@@ -0,0 +1,83 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================
+
+#ifndef TEAM_CONTROL_POINT_ROUND_H
+#define TEAM_CONTROL_POINT_ROUND_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "utlmap.h"
+#include "team.h"
+#include "teamplay_gamerules.h"
+#include "team_control_point.h"
+#include "trigger_area_capture.h"
+#include "team_objectiveresource.h"
+
+
+class CTeamControlPointRound : public CBaseEntity
+{
+ DECLARE_CLASS( CTeamControlPointRound, CBaseEntity );
+
+public:
+ virtual void Spawn( void );
+ virtual void Activate( void );
+
+ bool IsDisabled( void ){ return m_bDisabled; }
+
+ int GetPointOwner( int point );
+// int CountAdvantageFlags( int team );
+ bool WouldNewCPOwnerWinGame( CTeamControlPoint *pPoint, int iNewOwner );
+
+ void FireTeamWinOutput( int iWinningTeam );
+
+ void SelectedToPlay( void );
+
+ int CheckWinConditions( void ); // returns the team number of the team that's won, or returns -1 if no winner
+
+ int GetPriorityValue( void ) const { return m_nPriority; }
+
+ bool IsPlayable( void );
+ bool MakePlayable( void );
+ bool IsControlPointInRound( CTeamControlPoint *pPoint );
+
+ void FireOnStartOutput( void );
+ void FireOnEndOutput( void );
+
+ inline const char *GetName( void ) { return STRING(m_iszPrintName); }
+
+ CHandle<CTeamControlPoint> GetPointOwnedBy( int iTeam );
+
+ bool RoundOwnedByTeam( int iTeam ) const { return ( TeamOwnsAllPoints() == iTeam ); }
+ int GetInvalidCapWinner() { return m_iInvalidCapWinner; }
+
+ CUtlVector< CHandle<CTeamControlPoint> > m_ControlPoints;
+
+private:
+ void FindControlPoints( void ); //look in the map to find the control points for this round
+ void SetupSpawnPoints( void );
+ int TeamOwnsAllPoints( CTeamControlPoint *pOverridePoint = NULL, int iOverrideNewTeam = TEAM_UNASSIGNED ) const;
+
+ DECLARE_DATADESC();
+
+ bool m_bDisabled;
+ void InputEnable( inputdata_t &inputdata );
+ void InputDisable( inputdata_t &inputdata );
+
+ void InputRoundSpawn( inputdata_t &inputdata );
+
+ string_t m_iszCPNames;
+ int m_nPriority;
+ int m_iInvalidCapWinner;
+ string_t m_iszPrintName;
+
+ COutputEvent m_OnStart;
+ COutputEvent m_OnEnd;
+ COutputEvent m_OnWonByTeam1;
+ COutputEvent m_OnWonByTeam2;
+};
+
+#endif // TEAM_CONTROL_POINT_ROUND_H