blob: 0d881497ec76e51b7aa9c3990f0eca67e1d5b46d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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()
{
}
|