This commit is contained in:
parent
b09b683727
commit
1027011447
|
@ -47,10 +47,13 @@
|
||||||
<button (click)="switchToNextPage()" [disabled]="!calculatePointSum()">Next</button>
|
<button (click)="switchToNextPage()" [disabled]="!calculatePointSum()">Next</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="which-solo" class="visible-{{this.currentPage === 4}}">
|
<div id="which-solo" class="visible-{{this.currentPage === 4}}">
|
||||||
|
<p>Select the Solo that has been played:</p>
|
||||||
|
<div class="togglebtn active-{{isSoloActive(solo)}}" *ngFor="let solo of getAllPossibleSolos()" (click)="toggleSolo(solo)">{{solo.toString()}}</div>
|
||||||
|
<button (click)="switchToNextPage()">Next</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="extra-points" class="visible-{{this.currentPage === 5}}">
|
<div id="extra-points" class="visible-{{this.currentPage === 5}}">
|
||||||
|
<p>Extra Points</p>
|
||||||
|
<button (click)="switchToNextPage()">Next</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="scores">
|
<div id="scores">
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import {Component, OnInit} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import {Player} from '../../models/doppelkopf/player';
|
import {Player} from '../../models/doppelkopf/player';
|
||||||
import * as announcements from '../../models/doppelkopf/enums/announcement';
|
import * as announcements from '../../models/doppelkopf/enums/announcement';
|
||||||
|
import * as solos from '../../models/doppelkopf/enums/solo';
|
||||||
import {Team} from '../../models/doppelkopf/enums/team';
|
import {Team} from '../../models/doppelkopf/enums/team';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -13,6 +14,7 @@ export class AddGameComponent implements OnInit {
|
||||||
actualPlayers: Player[] = [];
|
actualPlayers: Player[] = [];
|
||||||
|
|
||||||
selectedAnnouncements: announcements.Announcement[] = [];
|
selectedAnnouncements: announcements.Announcement[] = [];
|
||||||
|
soloPlayed?: solos.Solo;
|
||||||
|
|
||||||
currentPage: number = 0;
|
currentPage: number = 0;
|
||||||
|
|
||||||
|
@ -81,6 +83,11 @@ export class AddGameComponent implements OnInit {
|
||||||
this.calculateCurrentScores();
|
this.calculateCurrentScores();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(this.currentPage === 3 && !this.checkIfSolo()) {
|
||||||
|
// If we don't play a solo, we can skip the solo page
|
||||||
|
this.currentPage++;
|
||||||
|
}
|
||||||
|
|
||||||
this.currentPage++;
|
this.currentPage++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -632,4 +639,16 @@ export class AddGameComponent implements OnInit {
|
||||||
|
|
||||||
return numberOfElders === 1;
|
return numberOfElders === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isSoloActive(solo: solos.Solo): boolean {
|
||||||
|
return this.soloPlayed === solo;
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllPossibleSolos(): solos.Solo[] {
|
||||||
|
return solos.getAllSoloValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleSolo(solo: solos.Solo): void {
|
||||||
|
this.soloPlayed = solo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,24 @@
|
||||||
export enum Solo {
|
export enum Solo {
|
||||||
QUEENS = 0,
|
QUEENS = 'Queens',
|
||||||
JACKS = 1,
|
JACKS = 'Jacks',
|
||||||
COLOR_CHECKS = 2,
|
COLOR_CHECKS = 'Checks',
|
||||||
COLOR_HEART = 3,
|
COLOR_HEART = 'Heart',
|
||||||
COLOR_SPADES = 4,
|
COLOR_SPADES = 'Spades',
|
||||||
COLOR_CROSS = 5,
|
COLOR_CROSS = 'Cross',
|
||||||
FLESHLESS = 6
|
FLESHLESS = 'Fleshless'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all available solo values
|
||||||
|
*/
|
||||||
|
export function getAllSoloValues(): Solo[] {
|
||||||
|
return [
|
||||||
|
Solo.QUEENS,
|
||||||
|
Solo.JACKS,
|
||||||
|
Solo.COLOR_CHECKS,
|
||||||
|
Solo.COLOR_HEART,
|
||||||
|
Solo.COLOR_SPADES,
|
||||||
|
Solo.COLOR_CROSS,
|
||||||
|
Solo.FLESHLESS
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user