summaryrefslogtreecommitdiff
path: root/utils/tfstats/matchresults.h
blob: 7a8d555adfd6600b7bafc837e2405972e995ea76 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//
//=============================================================================//
#include "report.h"

class CMatchResults: public CReport
{
public:
	enum Consts
	{
		WINNER=1,
		LOSER=0,

		STRLEN=200,
	};
private:
	struct team
	{
		bool valid;
		int score;
		int frags;
		int unacc_frags;
		int numplayers;
		bool fWinner;
		bool allies[MAX_TEAMS];
	};

	team teams[MAX_TEAMS];
	int numTeams;
	char winnerString[STRLEN];
	char loserString[STRLEN];

	bool valid;
	bool draw;

	void init();

	void calcRealWinners();

	char* getWinnerTeamsString();
	int getWinnerTeamScore();
	bool Outnumbered(int WinnerOrLoser);
	char* getLoserTeamsString();
	int getLoserTeamScore();
	int numWinningTeams();

public:

	explicit CMatchResults(){init();}

	void generate();
	void writeHTML(CHTMLFile& html);
};