diff --git a/src/app/components/add-game/add-game.component.html b/src/app/components/add-game/add-game.component.html index c1ab94c..481ce98 100644 --- a/src/app/components/add-game/add-game.component.html +++ b/src/app/components/add-game/add-game.component.html @@ -54,7 +54,16 @@

Extra Points

- +
+

{{player.firstName}}

+ +
+

Please check the number of caught foxes!

+ +
+
+

Game Summary

+
diff --git a/src/app/components/add-game/add-game.component.ts b/src/app/components/add-game/add-game.component.ts index b6e30d5..c101b25 100644 --- a/src/app/components/add-game/add-game.component.ts +++ b/src/app/components/add-game/add-game.component.ts @@ -663,6 +663,9 @@ export class AddGameComponent implements OnInit { this.soloPlayed = solo; } + /** + * Returns true if there is a solo selected, false otherwise + */ noSoloSelectedYet(): boolean { return this.soloPlayed === undefined; } @@ -675,5 +678,23 @@ export class AddGameComponent implements OnInit { * /_____/_/|_|\__/_/ \__,_/ /_/ \____/_/_/ /_/\__/____/ */ + /** + * Checks if the number of caught foxes checks out + */ + checkTotalFoxPoints(): boolean { + let totalFoxPoints: number = 0; + for (let player of this.actualPlayers) { + totalFoxPoints += player.foxesCaught ?? 0; + } + + return totalFoxPoints <= 2; + } + + /** + * Checks if all extra point types have valid entries + */ + checkAllExtraPoints(): boolean { + return this.checkTotalFoxPoints(); + } }