Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TEAM_CONTROL_POINT_ROUND_H
  7. #define TEAM_CONTROL_POINT_ROUND_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "utlmap.h"
  12. #include "team.h"
  13. #include "teamplay_gamerules.h"
  14. #include "team_control_point.h"
  15. #include "trigger_area_capture.h"
  16. #include "team_objectiveresource.h"
  17. class CTeamControlPointRound : public CBaseEntity
  18. {
  19. DECLARE_CLASS( CTeamControlPointRound, CBaseEntity );
  20. public:
  21. virtual void Spawn( void );
  22. virtual void Activate( void );
  23. bool IsDisabled( void ){ return m_bDisabled; }
  24. int GetPointOwner( int point );
  25. // int CountAdvantageFlags( int team );
  26. bool WouldNewCPOwnerWinGame( CTeamControlPoint *pPoint, int iNewOwner );
  27. void FireTeamWinOutput( int iWinningTeam );
  28. void SelectedToPlay( void );
  29. int CheckWinConditions( void ); // returns the team number of the team that's won, or returns -1 if no winner
  30. int GetPriorityValue( void ) const { return m_nPriority; }
  31. bool IsPlayable( void );
  32. bool MakePlayable( void );
  33. bool IsControlPointInRound( CTeamControlPoint *pPoint );
  34. void FireOnStartOutput( void );
  35. void FireOnEndOutput( void );
  36. inline const char *GetName( void ) { return STRING(m_iszPrintName); }
  37. CHandle<CTeamControlPoint> GetPointOwnedBy( int iTeam );
  38. bool RoundOwnedByTeam( int iTeam ) const { return ( TeamOwnsAllPoints() == iTeam ); }
  39. int GetInvalidCapWinner() { return m_iInvalidCapWinner; }
  40. CUtlVector< CHandle<CTeamControlPoint> > m_ControlPoints;
  41. private:
  42. void FindControlPoints( void ); //look in the map to find the control points for this round
  43. void SetupSpawnPoints( void );
  44. int TeamOwnsAllPoints( CTeamControlPoint *pOverridePoint = NULL, int iOverrideNewTeam = TEAM_UNASSIGNED ) const;
  45. DECLARE_DATADESC();
  46. bool m_bDisabled;
  47. void InputEnable( inputdata_t &inputdata );
  48. void InputDisable( inputdata_t &inputdata );
  49. void InputRoundSpawn( inputdata_t &inputdata );
  50. string_t m_iszCPNames;
  51. int m_nPriority;
  52. int m_iInvalidCapWinner;
  53. string_t m_iszPrintName;
  54. COutputEvent m_OnStart;
  55. COutputEvent m_OnEnd;
  56. COutputEvent m_OnWonByTeam1;
  57. COutputEvent m_OnWonByTeam2;
  58. };
  59. #endif // TEAM_CONTROL_POINT_ROUND_H