summaryrefslogtreecommitdiff
path: root/utils/tfstats/award.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/tfstats/award.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'utils/tfstats/award.cpp')
-rw-r--r--utils/tfstats/award.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/utils/tfstats/award.cpp b/utils/tfstats/award.cpp
new file mode 100644
index 0000000..0d88149
--- /dev/null
+++ b/utils/tfstats/award.cpp
@@ -0,0 +1,59 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Implementation of CAward
+//
+// $Workfile: $
+// $Date: $
+//
+//------------------------------------------------------------------------------------------------------
+// $Log: $
+//
+// $NoKeywords: $
+//=============================================================================//
+#include "Award.h"
+
+//------------------------------------------------------------------------------------------------------
+// Function: CAward::CAward
+// Purpose: Constructor.
+// Input: name - the name of the award
+// pmi - a pointer to the match information
+//------------------------------------------------------------------------------------------------------
+CAward::CAward(char* name)
+:awardName(name),fNoWinner(true),winnerID(-1)
+{}
+
+//------------------------------------------------------------------------------------------------------
+// Function: CAward::generate
+// Purpose: overrides generate to call the more-semantically correct getWinner()
+// when dealing with subclasses of awards. Also after getWinner has determined
+// which PID is the winner, this assigns the correct name to the winnerName field
+//------------------------------------------------------------------------------------------------------
+void CAward::generate()
+{
+ winnerName="";
+ getWinner();
+ if (winnerID!=-1)
+ winnerName=g_pMatchInfo->playerName(winnerID);
+}
+
+//------------------------------------------------------------------------------------------------------
+// Function: CAward::writeHTML
+// Purpose: writes the award to the given html page
+// Input: html - the page to output the award to
+//------------------------------------------------------------------------------------------------------
+void CAward::writeHTML(CHTMLFile& html)
+{
+ if (fNoWinner || (winnerID == -1 && winnerName==""))
+ noWinner(html);
+ else
+ {
+ html.write("The <font class=brightawards>%s</font> award goes to %s! ",awardName.c_str(),winnerName.c_str());
+ extendedinfo(html);
+ }
+ html.br();
+ html.write("\n");
+}
+CAward::~CAward()
+{
+
+}