This commit is contained in:
parent
6d2c750a58
commit
e8165727de
|
@ -432,6 +432,7 @@ export class AddGameComponent implements OnInit {
|
|||
|
||||
// TODO: Bonus points
|
||||
gameScore += this.getFinalFoxPoints(winningTeam);
|
||||
gameScore += this.getCharliePoints(winningTeam);
|
||||
|
||||
// TODO: Check for announcements that have not been fulfilled!
|
||||
|
||||
|
@ -534,4 +535,18 @@ export class AddGameComponent implements OnInit {
|
|||
|
||||
return finalPoints;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the extra points for a when a charlie made the final trick.
|
||||
* If the winning team played the charlie, they get one point. If the losing team played the charlie, the winning team loses one point.
|
||||
* @param winningTeam The winning team
|
||||
*/
|
||||
getCharliePoints(winningTeam: Team): number {
|
||||
for(let player of this.actualPlayers) {
|
||||
if(player.wonLastTrickWithCharlie) {
|
||||
return player.team === winningTeam ? 1 : -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,4 +10,5 @@ export interface Player {
|
|||
hadTrumpHandoff?: boolean;
|
||||
team?: Team;
|
||||
foxesCaught?: number;
|
||||
wonLastTrickWithCharlie?: boolean;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user