-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.cpp
More file actions
52 lines (47 loc) · 2.16 KB
/
data.cpp
File metadata and controls
52 lines (47 loc) · 2.16 KB
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
#include "data.h"
#include "database.h"
bool EloData::sortingHelper(const EloData& lhs, const EloData& rhs)
{
return lhs.rating > rhs.rating;
}
//bool StandingData::standingsSortingHelperRoundRobin(
// const StandingData& lhs, const StandingData& rhs )
//{
// if ( lhs.set_wins > rhs.set_wins ){ return true; }
// else if ( lhs.set_wins < rhs.set_wins ){ return false; }
// int lhs_games_diff = static_cast<int>(lhs.game_wins) - static_cast<int>(lhs.game_losses);
// int rhs_games_diff = static_cast<int>(rhs.game_wins) - static_cast<int>(rhs.game_losses);
// if ( lhs_games_diff > rhs_games_diff ){ return true; }
// else if ( lhs_games_diff < rhs_games_diff ){ return false; }
// if ( lhs.won_against.contains(rhs.player) )
// { return true; }
// //else
// return false;
//}
//void fillStandingsMap( const std::vector<MatchData>& match_data,
// QMap<QString,StandingData>& standings_map )
//{
// for ( size_t i = 0; i < match_data.size(); i++ )
// {
// const MatchData& match_date = match_data[i];
// standings_map[match_date.p1.name].player = match_date.p1.name;
// standings_map[match_date.p2.name].player = match_date.p2.name;
// standings_map[match_date.p1.name].game_wins += match_date.p1_wins;
// standings_map[match_date.p2.name].game_wins += match_date.p2_wins;
// standings_map[match_date.p1.name].game_losses += match_date.p2_wins;
// standings_map[match_date.p2.name].game_losses += match_date.p1_wins;
// //standings_map[match_date.p2].group_player_ids += match_date.group_player_ids;
// if ( match_date.p1_wins > match_date.p2_wins )
// { standings_map[match_date.p1.name].won_against.insert(match_date.p2.name); }
// if ( match_date.p1_wins > match_date.p2_wins )
// {
// standings_map[match_date.p1.name].set_wins++;
// standings_map[match_date.p2.name].set_losses++;
// }
// else
// {
// standings_map[match_date.p1.name].set_losses++;
// standings_map[match_date.p2.name].set_wins++;
// }
// }
//}