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: Implementation of CWhoKilledWho
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //------------------------------------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #ifndef WHOKILLEDWHO_H
  14. #define WHOKILLEDWHO_H
  15. #ifdef WIN32
  16. #pragma once
  17. #endif
  18. #include "report.h"
  19. //------------------------------------------------------------------------------------------------------
  20. // Purpose: CWhoKilledWho is a report element that outputs a detailed scoreboard
  21. // showing, in a 2x2 matrix who killed who how many times. On the edges of the
  22. // matrix, total kills and total deaths for each player are also tallied up
  23. //------------------------------------------------------------------------------------------------------
  24. class CWhoKilledWho :public CReport
  25. {
  26. private:
  27. int* kills;
  28. int size;
  29. int* deaths;
  30. //bids map from a player ID to a "board ID" because
  31. //player IDs are not necessarily contiguous
  32. //and rarely start at 0
  33. map<PID,int> bids;
  34. int nextbid;
  35. //this maps from bids back to pids
  36. map<int,PID> pids;
  37. map<pair<int,PID>,int> bidMap;
  38. map<int,pair<int,PID> > bidMap2;
  39. //returns the style class for a cell in the html table
  40. const char* getCellClass(int u,int v);
  41. void init();
  42. void makeBidMap();
  43. public:
  44. explicit CWhoKilledWho(){kills=deaths=NULL;init();}
  45. void generate();
  46. void writeHTML(CHTMLFile& html);
  47. ~CWhoKilledWho();
  48. };
  49. #endif // WHOKILLEDWHO_H