Move to new server

This commit is contained in:
2024-10-12 13:38:41 +02:00
commit e2e855e9b9
113 changed files with 11268 additions and 0 deletions

View File

@@ -0,0 +1,429 @@
@if (tournament) {
<mat-card appearance="outlined">
<!--
<mat-card-header>
<h5>{{ tournament.name }}</h5>
</mat-card-header>
-->
<mat-card-content>
<mat-tab-group animationDuration="0ms" disableRipple="true">
@if (tournament.status == 'UPCOMING') {
<mat-tab>
<ng-template mat-tab-label>
<mat-icon>playlist_add_check</mat-icon>
&nbsp;Validaties
<button mat-icon-button [matMenuTriggerFor]="upcomingTournamentMenu" class="menu-button m-3">
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #upcomingTournamentMenu="matMenu">
<button mat-menu-item (click)="divideTournament()">
<mat-icon>play_arrow</mat-icon>
Deel toernooi in
</button>
</mat-menu>
</ng-template>
<app-tournament-validate></app-tournament-validate>
</mat-tab>
}
@if (tournament.status == 'DIVIDED') {
<mat-tab>
<ng-template mat-tab-label>
<mat-icon>safety_divider</mat-icon>
&nbsp;Indeling
<button mat-icon-button [matMenuTriggerFor]="dividedTournamentMenu" class="menu-button m-3">
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #dividedTournamentMenu="matMenu">
<button mat-menu-item (click)="clearDivision()">
<mat-icon>highlight_remove</mat-icon>
Indeling wissen
</button>
<button mat-menu-item (click)="drawTournament()">
<mat-icon>safety_divider</mat-icon>
1e ronde loten
</button>
</mat-menu>
</ng-template>
<mat-card *ngFor="let event of tournament.events" appearance="outlined" class="m-3">
<mat-card-header>
<h6>Indeling {{ TournamentEvent.getType(event.type) }}</h6>
</mat-card-header>
<mat-card-content>
<mat-accordion multi="true">
<mat-expansion-panel *ngFor="let group of event.groups">
<mat-expansion-panel-header>
<mat-panel-title>
{{ group.name }}&nbsp;<span class="badge text-bg-success">{{ group.teams.length }}</span>
</mat-panel-title>
</mat-expansion-panel-header>
<table class="table {{ event.doublesEvent ? 'w-100' : 'w-50' }}">
<thead class="thead-dark">
<tr>
<th scope="col" class="w-20">Naam</th>
<th scope="col" class="w-20">Club</th>
<th scope="col" class="w-10">Speelsterkte</th>
<th *ngIf="event.doublesEvent" scope="col" class="w-20">Partner</th>
<th *ngIf="event.doublesEvent" scope="col" class="w-20">Club</th>
<th *ngIf="event.doublesEvent" scope="col" class="w-10">Speelsterkte</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let team of group.teams">
<td class="align-middle">{{ team.player1 | fullName }}</td>
<td class="align-middle">{{ team.player1.club }}</td>
<td class="align-middle">{{ getStrength(team.player1.strength.valueOf()) }}</td>
<td *ngIf="event.doublesEvent" class="align-middle">{{ team.player2 | fullName }}</td>
<td *ngIf="event.doublesEvent" class="align-middle">{{ team.player2?.club }}</td>
<td *ngIf="event.doublesEvent" class="align-middle">{{ getStrength(team.player2?.strength?.valueOf()) }}</td>
</tr>
</tbody>
</table>
</mat-expansion-panel>
</mat-accordion>
</mat-card-content>
</mat-card>
</mat-tab>
}
@if (tournament.status == 'ONGOING') {
<mat-tab>
<ng-template mat-tab-label>
<mat-icon>play_arrow</mat-icon>
&nbsp;Actieve wedstrijden
&nbsp;
@if (this.activeMatches().length > 0) {
<span class="badge text-bg-success">{{ this.activeMatches().length }}</span>
}
</ng-template>
@if (this.activeMatches().length > 0) {
<table class="table table-hover w-100 m-4">
<thead>
<tr>
<th colspan="3">Wedstrijd</th>
<th>Onderdeel/Ronde</th>
<th>Start</th>
<th>Baan</th>
<th></th>
</tr>
</thead>
<tbody>
@for (activeMatch of this.activeMatches(); track activeMatch.match.id) {
<tr>
<td class="align-middle">{{ activeMatch.match.team1 | teamText }}</td>
<td class="align-middle">-</td>
<td class="align-middle">{{ activeMatch.match.team2 | teamText }}</td>
<td class="align-middle">{{ activeMatch.group.name }} {{ activeMatch.round.name }}</td>
<td class="align-middle">{{ activeMatch.match.startTime | date: 'HH:mm' }}</td>
<td class="align-middle">{{ activeMatch.match.court }}</td>
<td nowrap class="align-middle">
<button class="align-baseline" mat-button (click)="editResult(activeMatch.match, activeMatch.group, activeMatch.round)">
<mat-icon>edit</mat-icon>
Uitslag invoeren
</button>
<button mat-icon-button [matMenuTriggerFor]="activeMatchMenu" [matMenuTriggerData]="{ match: activeMatch.match }" class="menu-button">
<mat-icon>more_vert</mat-icon>
</button>
</td>
</tr>
}
</tbody>
</table>
<mat-menu #activeMatchMenu="matMenu">
<ng-template matMenuContent let-match="match">
<button mat-button (click)="stopMatch(match)">
<mat-icon>stop</mat-icon>
Wedstrijd stoppen
</button>
</ng-template>
</mat-menu>
} @else {
<h6 class="mt-3">Geen actieve wedstrijden</h6>
}
</mat-tab>
}
@if (tournament.status == 'ONGOING' || tournament.status == 'DRAWN') {
<mat-tab>
<ng-template mat-tab-label>
<mat-icon>list</mat-icon>
&nbsp;Onderdelen
</ng-template>
<mat-tab-group animationDuration="0ms" disableRipple="true">
<ng-container *ngFor="let event of tournament.events">
<ng-container *ngFor="let group of event.groups">
<mat-tab label="{{group.id}}">
<ng-template mat-tab-label>
<!--<mat-icon>list</mat-icon>&nbsp;-->
{{ group.name }}
&nbsp;
@if (getActiveMatchCountForGroup(group) > 0) {
<span class="badge text-bg-success">{{ getActiveMatchCountForGroup(group) }}</span>
}
@if (group.status != 'FINISHED' && groupOnlyHasFinishedRounds(group)) {
<button mat-icon-button [matMenuTriggerFor]="groupMenu" class="menu-button m-3">
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #groupMenu="matMenu">
<button mat-menu-item (click)="finishGroup(group)">
<mat-icon>check</mat-icon>
Onderdeel afsluiten
</button>
</mat-menu>
}
</ng-template>
<mat-tab-group
animationDuration="0ms"
disableRipple="true"
[(selectedIndex)]="activeRoundTab"
(selectedTabChange)="onRoundTabChange($event)">
<ng-container *ngFor="let round of group.rounds; index as roundIndex">
<mat-tab label="{{round.id}}">
<ng-template mat-tab-label>
<mat-icon>{{ getRoundIcon(round.status) }}</mat-icon>
&nbsp;{{ round.name }}
<button mat-icon-button [matMenuTriggerFor]="activeRoundMenu" class="menu-button m-3">
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #activeRoundMenu="matMenu">
@if (round.status == 'NOT_STARTED') {
<button mat-menu-item (click)="startRound(round)">
<mat-icon>play_arrow</mat-icon>
Ronde starten
</button>
<button mat-menu-item (click)="printMatchSheets(round)">
<mat-icon>print</mat-icon>
Wedstrijdbriefjes printen
</button>
}
<button mat-menu-item (click)="printRoundOverview(round)">
<mat-icon>print</mat-icon>
Rondeoverzicht printen
</button>
@if (round.status == 'IN_PROGRESS' && checkRoundComplete(round)) {
<button mat-menu-item (click)="finishRound(round)">
<mat-icon>check</mat-icon>
Ronde afsluiten
</button>
}
@if (group.status != 'FINISHED' && round.status == 'FINISHED' && (roundIndex + 1) == group.rounds.length) {
<button mat-menu-item (click)="newRound(group)">
<mat-icon>playlist_add</mat-icon>
Nieuwe ronde
</button>
}
</mat-menu>
</ng-template>
<h6 class="mt-3">Wedstrijden</h6>
@if (round.status == 'NOT_STARTED') {
<table class="table table-hover m-4 wide w-100">
<tbody>
<tr *ngFor="let match of round.matches">
<td class="align-middle w-team">{{ match.team1 | teamText }}</td>
<td class="align-middle w-sep">-</td>
<td class="align-middle w-team">{{ match.team2 | teamText }}</td>
<td class="align-middle w-fill"></td>
</tr>
@if (round.drawnOut) {
<tr>
<td class="align-middle w-100" colspan="4"><b>Deze ronde uitgeloot:</b> {{ round.drawnOut | teamText }}</td>
</tr>
}
</tbody>
</table>
} @else if (round.status == 'IN_PROGRESS') {
<table class="table table-hover m-4 wide w-100">
<tbody>
<tr *ngFor="let match of round.matches">
<td class="align-middle w-team" [ngClass]="{'winner': checkWinner(match) == 1}">{{ match.team1 | teamText }}</td>
<td class="align-middle w-sep">-</td>
<td class="align-middle w-team" [ngClass]="{'winner': checkWinner(match) == 2}">{{ match.team2 | teamText }}</td>
<td class="align-middle w-fill">
@if (match.status == 'NOT_STARTED') {
<button mat-button (click)="startMatch(match)">
<mat-icon>play_arrow</mat-icon>
Wedstrijd starten
</button>
} @else if (match.status == 'IN_PROGRESS') {
<button mat-button (click)="editResult(match, group, round)">
<mat-icon>edit</mat-icon>
Uitslag invoeren
</button>
<button mat-button (click)="stopMatch(match)">
<mat-icon>stop</mat-icon>
Wedstrijd stoppen
</button>
} @else if (match.status == 'FINISHED') {
<div class="row result align-items-center">
<span *ngFor="let game of match.games" class="col-2">{{ game.score1 }}-{{ game.score2 }}</span>
@if (match.games.length == 2) {
<span class="col-2"></span>
}
<button mat-icon-button [matMenuTriggerFor]="finishedMatchMenu" class="menu-button m-3">
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #finishedMatchMenu="matMenu">
<button mat-menu-item (click)="editResult(match, group, round)">
<mat-icon>edit</mat-icon>
Uitslag bewerken
</button>
</mat-menu>
</div>
}
</td>
</tr>
@if (round.drawnOut) {
<tr>
<td class="align-middle w-100" colspan="4"><b>Deze ronde uitgeloot:</b> {{ round.drawnOut | teamText }}</td>
</tr>
}
</tbody>
</table>
} @else if (round.status == 'FINISHED') {
<table class="table table-hover m-4 wide {{ this.groupIsDoublesType(group) ? 'w-100' : 'w-100' }}">
<tbody>
<tr *ngFor="let match of round.matches">
<td class="align-middle w-team" [ngClass]="{'winner': checkWinner(match) == 1}">{{ match.team1 | teamText }}</td>
<td class="align-middle w-sep">-</td>
<td class="align-middle w-team" [ngClass]="{'winner': checkWinner(match) == 2}">{{ match.team2 | teamText }}</td>
<td class="align-middle w-fill">
<div class="row result align-items-center">
<span *ngFor="let game of match.games" class="col-2">{{ game.score1 }}-{{ game.score2 }}</span>
@if (match.games.length == 2) {
<span class="col-2"></span>
}
</div>
</td>
</tr>
@if (round.drawnOut) {
<tr>
<td class="align-middle w-100" colspan="4"><b>Deze ronde uitgeloot:</b> {{ round.drawnOut | teamText }}</td>
</tr>
}
</tbody>
</table>
}
<h6 class="mt-3">Stand</h6>
<table class="table w-75 m-4">
<caption>Tussen haakjes de gemiddelden per gespeelde wedstrijd</caption>
<thead>
<tr>
<th>#</th>
<th>
@if (event.doublesEvent) {
Team
} @else {
Speler
}
</th>
<th>Gespeeld</th>
<th>Punten</th>
<th>Games</th>
<th>Wedstrijdpunten</th>
</tr>
</thead>
<tbody class="table-group-divider">
<tr *ngFor="let entry of getStandingsForRound(round, group).entries">
<td class="align-middle">{{ entry.position }}</td>
<td class="align-middle">{{ entry.team | teamText }}</td>
<td class="align-middle">{{ entry.played }}</td>
<td class="align-middle">
@if (entry.played > 0 ) {
{{ entry.points }} ({{ entry.points / entry.played | number: '1.0-2' }})
}
</td>
<td class="align-middle">
@if (entry.played > 0 ) {
{{ entry.gamesWon }}-{{ entry.gamesLost}} ({{ (entry.gamesWon - entry.gamesLost) / entry.played | number: '1.0-2' }})
}
</td>
<td class="align-middle">
@if (entry.played > 0 ) {
{{ entry.pointsWon }}-{{ entry.pointsLost }} ({{ (entry.pointsWon - entry.pointsLost) / entry.played | number: '1.0-2' }})
}
</td>
</tr>
</tbody>
</table>
</mat-tab>
</ng-container>
</mat-tab-group>
</mat-tab>
</ng-container>
</ng-container>
</mat-tab-group>
</mat-tab>
}
@if (tournament.status == 'ONGOING' || tournament.status == 'DRAWN') {
<mat-tab>
<ng-template mat-tab-label>
<mat-icon>settings</mat-icon>
&nbsp;Beheer
</ng-template>
<mat-tab-group animationDuration="0ms" disableRipple="true">
<mat-tab>
<ng-template mat-tab-label>
<mat-icon>group</mat-icon>
&nbsp;Spelerslijst
</ng-template>
<table class="table table-hover w-75 m-4">
<thead>
<tr>
<th>Naam</th>
<th>Onderdelen</th>
<th>Kosten</th>
<th>Betaald</th>
<th>Aanwezig</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let tournamentPlayer of tournament.tournamentPlayers">
<td>{{ tournamentPlayer.name }}</td>
<td>
<ng-container *ngFor="let event of tournamentPlayer.events">
{{ event }}&nbsp;
</ng-container>
</td>
<td>
{{ tournament.costsPerEvent[tournamentPlayer.events.length - 1] | currency:'EUR':'symbol':'1.2-2':'nl' }}
</td>
<td>
<mat-slide-toggle [(ngModel)]="tournamentPlayer.paid" (change)="playerPaid($event, tournamentPlayer.playerId)">
@if (tournamentPlayer.paid) {
Betaald
} @else {
Nog niet betaald
}
</mat-slide-toggle>
</td>
<td>
<mat-slide-toggle [(ngModel)]="tournamentPlayer.present" (change)="playerPresent($event, tournamentPlayer.playerId)">
@if (tournamentPlayer.present) {
Aanwezig
} @else {
Nog niet aanwezig
}
</mat-slide-toggle>
</td>
</tr>
</tbody>
</table>
</mat-tab>
</mat-tab-group>
</mat-tab>
}
</mat-tab-group>
</mat-card-content>
</mat-card>
}

View File

@@ -0,0 +1,26 @@
td {
vertical-align: middle;
}
td, th {
background-color: transparent !important;
}
table.wide td, table.wide th {
height: 4em;
}
.winner {
color: green;
font-weight: bold;
}
td.w-team {
width: 30%;
}
td.w-sep {
width: 5%;
}
td.w-fill {
width: 35%;
}

View File

@@ -0,0 +1,355 @@
import {Component, inject, Input, OnInit} from '@angular/core';
import {
MatAccordion,
MatExpansionPanel,
MatExpansionPanelDescription,
MatExpansionPanelHeader,
MatExpansionPanelTitle
} from "@angular/material/expansion";
import {MatCard, MatCardContent, MatCardHeader} from "@angular/material/card";
import {CurrencyPipe, DatePipe, DecimalPipe, NgClass, NgForOf, NgIf} from "@angular/common";
import {TeamPipe} from "../../pipes/team-pipe";
import {TournamentService} from "../../service/tournament.service";
import {ActivatedRoute, Router} from "@angular/router";
import {Tournament} from "../../model/tournament";
import {FullNamePipe} from "../../pipes/fullname-pipe";
import {MatList, MatListItem} from "@angular/material/list";
import {MatDivider} from "@angular/material/divider";
import {MatAnchor, MatButton, MatIconAnchor, MatIconButton, MatMiniFabAnchor} from "@angular/material/button";
import {MatIcon} from "@angular/material/icon";
import {Group} from "../../model/group";
import {Round} from "../../model/round";
import {MatTable} from "@angular/material/table";
import {StatusPipe} from "../../pipes/status-pipe";
import {MatMenu, MatMenuContent, MatMenuItem, MatMenuTrigger} from "@angular/material/menu";
import {Match} from "../../model/match";
import {FormsModule} from "@angular/forms";
import {MatTab, MatTabChangeEvent, MatTabGroup, MatTabLabel} from "@angular/material/tabs";
import {MatchResultComponent} from "../match-result/match-result.component";
import {MatDialog} from "@angular/material/dialog";
import {MatchResultPipe} from "../../pipes/match-result-pipe";
import {Event} from "../../model/event";
import {TournamentValidateComponent} from "../tournament-validate/tournament-validate.component";
import {Strength} from "../../model/player";
import {MatSlideToggle, MatSlideToggleChange} from "@angular/material/slide-toggle";
import {MatSnackBar} from "@angular/material/snack-bar";
import {CourtSelectionComponent} from "../court-selection/court-selection.component";
import {Standings} from "../../model/standings";
import {Title} from '@angular/platform-browser';
import {TitleService} from "../../service/title.service";
@Component({
selector: 'app-tournament-manage',
standalone: true,
imports: [
FullNamePipe,
MatAccordion,
MatCard,
MatCardContent,
MatCardHeader,
MatExpansionPanel,
MatExpansionPanelDescription,
MatExpansionPanelHeader,
MatExpansionPanelTitle,
NgForOf,
NgIf,
TeamPipe,
MatListItem,
MatDivider,
MatList,
MatAnchor,
MatIcon,
MatTable,
StatusPipe,
NgClass,
MatMenu,
MatMenuItem,
MatMenuTrigger,
FormsModule,
DatePipe,
MatTabGroup,
MatTab,
MatTabLabel,
MatButton,
MatchResultPipe,
MatIconAnchor,
MatMiniFabAnchor,
MatIconButton,
DecimalPipe,
TournamentValidateComponent,
MatSlideToggle,
CurrencyPipe,
MatMenuContent
],
providers: [
FullNamePipe,
TeamPipe,
MatchResultPipe
],
templateUrl: './tournament-manage.component.html',
styleUrl: './tournament-manage.component.scss'
})
export class TournamentManageComponent implements OnInit {
@Input() tournament: Tournament;
activeRoundTab: number = 0;
constructor(
private tournamentService: TournamentService,
private _snackBar: MatSnackBar,
private route: ActivatedRoute,
private router: Router,
private titleService: TitleService,
private title: Title
) {
}
ngOnInit() {
const id = this.route.snapshot.paramMap.get('id');
this.route.queryParams.subscribe(params => {
if (params['tab']) {
this.activeRoundTab = params['tab'];
}
})
this.tournamentService.getById(Number(id)).subscribe(data => {
this.tournament = data;
this.titleService.setTitle(this.tournament.name);
this.title.setTitle(this.tournament.name);
});
}
onRoundTabChange(event: MatTabChangeEvent) {
const index = event.index;
this.router.navigate(
['tournaments/' + this.tournament.id + '/manage'],
{
relativeTo: null, queryParams: {tab: index}
});
}
getRoundIcon(status: String) {
if (status == "FINISHED") {
return "check";
} else if (status == "IN_PROGRESS") {
return "play_arrow";
} else if (status == "NOT_STARTED") {
return "hourglass_top";
} else {
return "warning";
}
}
getStandingsForRound(round: Round, group: Group): Standings {
if (round.status == 'FINISHED') {
return round.standings;
} else {
return group.standings;
}
}
groupIsDoublesType(group: Group) {
return group.type == 'HD' || group.type == 'DD' || group.type == 'GD';
}
startRound(round: Round) {
this.tournamentService.startRound(this.tournament.id, round.id).subscribe(data => {
this.tournament = data;
});
}
finishRound(round: Round) {
this.tournamentService.finishRound(this.tournament.id, round.id).subscribe(data => {
this.tournament = data;
});
}
finishGroup(group: Group) {
this.tournamentService.finishGroup(this.tournament.id, group.id).subscribe(data => {
this.tournament = data;
});
}
divideTournament() {
this.tournamentService.divide(this.tournament.id).subscribe(data => {
this.tournament = data;
});
}
clearDivision() {
this.tournamentService.clearDivision(this.tournament.id).subscribe(data => {
this.tournament = data;
});
}
drawTournament() {
this.tournamentService.draw(this.tournament.id).subscribe(data => {
this.tournament = data;
});
}
startMatch(match: Match) {
const availableCourts = this.getAvailableCourts();
if (availableCourts.length == 0) {
alert('Geen banen beschikbaar!');
} else {
this.courtSelectionDialog.open(CourtSelectionComponent, {
data: {
match: match,
availableCourts: this.getAvailableCourts(),
totalCourts: this.tournament.courts
},
minWidth: '800px',
minHeight: '250px'
}).afterClosed().subscribe(result => {
if (result != undefined) {
this.tournamentService.startMatch(this.tournament.id, match.id, result).subscribe(data => {
this.tournament = data;
})
}
});
}
}
getAvailableCourts(): number[] {
const maxCourts = this.tournament.courts;
const activeCourts = this.activeMatches().map(activeMatch => activeMatch.match.court);
let i = 0, courts = Array(maxCourts);
while (i < maxCourts) courts[i++] = i;
return courts.filter(court => activeCourts.indexOf(court) < 0);
}
stopMatch(match: Match) {
this.tournamentService.stopMatch(this.tournament.id, match.id).subscribe(data => {
this.tournament = data;
})
}
newRound(group: Group) {
this.tournamentService.newRound(this.tournament.id, group.id).subscribe(data => {
this.tournament = data;
})
}
playerPaid($event: MatSlideToggleChange, playerId: number) {
this.tournamentService.playerPaid(this.tournament.id, playerId, $event.checked).subscribe(() => {
this._snackBar.open('Opgeslagen.');
});
}
playerPresent($event: MatSlideToggleChange, playerId: number) {
this.tournamentService.playerPresent(this.tournament.id, playerId, $event.checked).subscribe(() => {
this._snackBar.open('Opgeslagen.');
});
}
getStrength(strength: string | undefined) {
if (strength == undefined) return "";
for (let [key, value] of Object.entries(Strength)) {
if (key == strength) return value;
}
return "";
}
printMatchSheets(round: Round) {
window.open(`tournaments/${this.tournament.id}/rounds/${round.id}/matchsheets`, "_blank");
}
printRoundOverview(round: Round) {
window.open(`tournaments/${this.tournament.id}/rounds/${round.id}/overview`, "_blank");
}
activeMatches(): ActiveMatch[] {
let matches: ActiveMatch[] = [];
for (const event of this.tournament.events) {
for (const group of event.groups) {
for (const round of group.rounds) {
for (const match of round.matches) {
if (match.status == 'IN_PROGRESS') {
matches.push(new ActiveMatch(match, round, group));
}
}
}
}
}
return matches;
}
getActiveMatchCountForGroup(group: Group): number {
let active = 0;
for (const round of group.rounds) {
for (const match of round.matches) {
if (match.status == 'IN_PROGRESS') {
active++;
}
}
}
return active;
}
groupOnlyHasFinishedRounds(group: Group): boolean {
let allFinished = true;
for (const round of group.rounds) {
allFinished &&= round.status == 'FINISHED';
}
return allFinished;
}
matchResultDialog = inject(MatDialog);
courtSelectionDialog = inject(MatDialog);
editResult(match: Match, group: Group, round: Round) {
this.matchResultDialog.open(MatchResultComponent, {
data: {match: match, group: group, round: round},
minWidth: '800px'
}).afterClosed().subscribe(result => {
if (result != undefined) {
this.tournamentService.saveResult(this.tournament.id, result.matchId, result).subscribe(data => {
this.tournament = data;
})
}
});
}
checkWinner(match: Match): number {
if (match.games.length == 0) return 0;
if (match.games.length == 3) {
if (match.games[2].score1 > match.games[2].score2) {
return 1;
} else {
return 2;
}
}
if (match.games[1].score1 > match.games[1].score2) {
return 1;
} else {
return 2;
}
}
checkRoundComplete(round: Round) {
let complete: boolean = true;
for (let match of round.matches) {
complete &&= match.status == 'FINISHED';
}
return complete;
}
protected readonly TournamentEvent = Event;
}
class ActiveMatch {
constructor(match: Match, round: Round, group: Group) {
this.match = match;
this.round = round;
this.group = group;
}
match: Match;
round: Round;
group: Group;
}