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.

60 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Team management class. Contains all the details for a specific team
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef DOD_TEAM_H
  8. #define DOD_TEAM_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "utlvector.h"
  13. #include "team.h"
  14. #include "playerclass_info_parse.h"
  15. #include "dod_playerclass_info_parse.h"
  16. #include "dod_shareddefs.h"
  17. #include "dod_player.h"
  18. typedef CUtlLinkedList< PLAYERCLASS_FILE_INFO_HANDLE, int > PlayerClassInfoList;
  19. //-----------------------------------------------------------------------------
  20. // Purpose: Team Manager
  21. //-----------------------------------------------------------------------------
  22. class CDODTeam : public CTeam
  23. {
  24. DECLARE_CLASS( CDODTeam, CTeam );
  25. DECLARE_SERVERCLASS();
  26. public:
  27. // Initialization
  28. virtual void Init( const char *pName, int iNumber );
  29. CDODPlayerClassInfo const &GetPlayerClassInfo( int iPlayerClass ) const;
  30. const unsigned char *GetEncryptionKey( void ) { return g_pGameRules->GetEncryptionKey(); }
  31. virtual void AddPlayerClass( const char *pszClassName );
  32. bool IsClassOnTeam( const char *pszClassName, int &iClassNum ) const;
  33. int GetNumPlayerClasses( void ) { return m_hPlayerClassInfoHandles.Count(); }
  34. void ResetScores( void );
  35. virtual const char *GetTeamName( void ) { return "#Teamname_Spectators"; }
  36. virtual CDODPlayer *GetDODPlayer( int iIndex ) { return ToDODPlayer(GetPlayer(iIndex)); }
  37. private:
  38. CUtlVector < PLAYERCLASS_FILE_INFO_HANDLE > m_hPlayerClassInfoHandles;
  39. };
  40. extern CDODTeam *GetGlobalDODTeam( int iIndex );
  41. #endif // TF_TEAM_H