Use Player Links & match count
This commit is contained in:
@@ -345,6 +345,24 @@ export class TournamentManageComponent implements OnInit {
|
||||
|
||||
protected readonly TournamentEvent = Event;
|
||||
|
||||
getEventMatchCount(event: Event) {
|
||||
let count = 0;
|
||||
for (let group of event.groups) {
|
||||
let numTeams = group.teams.length;
|
||||
let rounds = Math.trunc(Math.log2(numTeams));
|
||||
let matchesPerRound = Math.trunc(numTeams / 2);
|
||||
count += (rounds * matchesPerRound);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
getTournamentMatchCount(tournament: Tournament) {
|
||||
let count = 0;
|
||||
for (let event of tournament.events) {
|
||||
count += this.getEventMatchCount(event);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
class ActiveMatch {
|
||||
|
||||
Reference in New Issue
Block a user