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.

62 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Interface to CCustomAward
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //------------------------------------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #ifndef CUSTOMAWARD_H
  14. #define CUSTOMAWARD_H
  15. #ifdef WIN32
  16. #pragma once
  17. #endif
  18. #pragma warning(disable :4786)
  19. #include "Award.h"
  20. #include "TextFile.h"
  21. #include "CustomAwardTriggers.h"
  22. #include <list>
  23. using namespace std;
  24. //------------------------------------------------------------------------------------------------------
  25. // Purpose: CCustomAward represents an award that is user-definable via
  26. // a configuration file. Other than their runtime definitions, Custom awards
  27. // act just like other static awards.
  28. //------------------------------------------------------------------------------------------------------
  29. class CCustomAward: public CAward
  30. {
  31. public:
  32. //factory method.
  33. static CCustomAward* readCustomAward(CTextFile& f);
  34. protected:
  35. list<CCustomAwardTrigger*> triggers;
  36. bool namemode;
  37. map<string,string> extraProps;
  38. map<PID,int> plrscores; //this is wrt to the current award. score in this sense is not related to game score
  39. // but simply a score that is relative to other contenders for the award.
  40. map<PID,int> plrnums; //this is the number of times any of the triggers was activated
  41. map<string,int> stringscores; //this is wrt to the current award. score in this sense is not related to game score
  42. // but simply a score that is relative to other contenders for the award.
  43. map<string,int> stringnums; //this is the number of times any of the triggers was activated
  44. string noWinnerMsg;
  45. string extraInfoMsg;
  46. virtual void extendedinfo(CHTMLFile& html);
  47. virtual void noWinner(CHTMLFile& html);
  48. public:
  49. explicit CCustomAward(CMatchInfo* pmi):CAward("custom_temp"){}
  50. void getWinner();
  51. };
  52. #endif // CUSTOMAWARD_H