Counter Strike : Global Offensive Source Code
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.

106 lines
2.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Client side CTeam class
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef C_TEAM_H
  8. #define C_TEAM_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "shareddefs.h"
  13. #include "utlvector.h"
  14. #include "client_thinklist.h"
  15. class C_BasePlayer;
  16. class C_Team : public C_BaseEntity
  17. {
  18. DECLARE_CLASS( C_Team, C_BaseEntity );
  19. public:
  20. DECLARE_CLIENTCLASS();
  21. DECLARE_PREDICTABLE();
  22. C_Team();
  23. virtual ~C_Team();
  24. virtual void PreDataUpdate( DataUpdateType_t updateType );
  25. // Data Handling
  26. virtual char *Get_Name( void );
  27. virtual char *Get_ClanName( void );
  28. virtual char *Get_FlagImageString( void );
  29. virtual char *Get_LogoImageString( void );
  30. int Get_Score( void ) { return m_scoreTotal; }
  31. int Get_Score_First_Half( void ) { return m_scoreFirstHalf; }
  32. int Get_Score_Second_Half( void ) { return m_scoreSecondHalf; }
  33. int Get_Score_Overtime( void ) { return m_scoreOvertime; }
  34. uint32 GetClanID( void ) { return m_iClanID; }
  35. virtual int Get_Deaths( void );
  36. virtual int Get_Ping( void );
  37. // Player Handling
  38. virtual int Get_Number_Players( void );
  39. virtual bool ContainsPlayer( int iPlayerIndex );
  40. C_BasePlayer* GetPlayer( int idx );
  41. // for shared code, use the same function name
  42. virtual int GetNumPlayers( void ) { return Get_Number_Players(); }
  43. virtual int GetGGLeader( int nTeam );
  44. int GetTeamNumber() const;
  45. void RemoveAllPlayers();
  46. // IClientThinkable overrides.
  47. public:
  48. virtual void ClientThink();
  49. public:
  50. // Data received from the server
  51. CUtlVector< int > m_aPlayers;
  52. char m_szTeamname[ MAX_TEAM_NAME_LENGTH ];
  53. char m_szClanTeamname[ MAX_TEAM_NAME_LENGTH ];
  54. char m_szTeamFlagImage[ MAX_TEAM_FLAG_ICON_LENGTH ];
  55. char m_szTeamLogoImage[ MAX_TEAM_LOGO_ICON_LENGTH ];
  56. char m_szTeamMatchStat[ MAX_PATH ];
  57. int m_scoreTotal;
  58. int m_scoreFirstHalf;
  59. int m_scoreSecondHalf;
  60. int m_scoreOvertime;
  61. int m_nGGLeaderEntIndex_CT;
  62. int m_nGGLeaderEntIndex_T;
  63. uint32 m_iClanID;
  64. // Data for the scoreboard
  65. int m_iDeaths;
  66. int m_iPing;
  67. int m_iPacketloss;
  68. int m_iTeamNum;
  69. int m_bSurrendered;
  70. int m_numMapVictories;
  71. };
  72. // Global list of client side team entities
  73. extern CUtlVector< C_Team * > g_Teams;
  74. // Global team handling functions
  75. C_Team *GetLocalTeam( void );
  76. C_Team *GetGlobalTeam( int iTeamNumber );
  77. C_Team *GetPlayersTeam( int iPlayerIndex );
  78. C_Team *GetPlayersTeam( C_BasePlayer *pPlayer );
  79. bool ArePlayersOnSameTeam( int iPlayerIndex1, int iPlayerIndex2 );
  80. extern int GetNumberOfTeams( void );
  81. #endif // C_TEAM_H