Refactoring score calculation logic
This commit is contained in:
@@ -28,8 +28,7 @@ export function getAllAnnouncementValues(): Announcement[] {
|
||||
/**
|
||||
* Checks if the selected announcements are a valid set of announcements.
|
||||
* E.g.: If RE_NO_NINETY is newly selected, RE also has to be selected
|
||||
* @param alreadySelected
|
||||
* @param newSelected
|
||||
* @param selectedAnnouncements The list of selected announcements
|
||||
*/
|
||||
export function checkValidity(selectedAnnouncements: Announcement[]): boolean {
|
||||
// First check all "RE" Announcements
|
||||
@@ -70,6 +69,10 @@ export function checkValidity(selectedAnnouncements: Announcement[]): boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the names of the two highest announcements from the given list, one for RE and one for CONTRA if applicable
|
||||
* @param selectedAnnouncements The list of announcements to check
|
||||
*/
|
||||
export function returnTwoHighestAnnouncements(selectedAnnouncements: Announcement[]): string {
|
||||
let finalString: string = '';
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@ import {Solo} from './enums/solo';
|
||||
export interface Game {
|
||||
gameId: number;
|
||||
players: Player[];
|
||||
foxesCaught: number;
|
||||
announcements: Announcement[];
|
||||
solo?: Solo;
|
||||
againstTheElders: boolean;
|
||||
}
|
||||
|
||||
@@ -4,9 +4,10 @@ export interface Player {
|
||||
firebonkId: number;
|
||||
uuid: string;
|
||||
firstName: string;
|
||||
finalCardScore?: number;
|
||||
gamePoints?: number;
|
||||
finalCardScore: number;
|
||||
gamePoints: number;
|
||||
hadMarriage?: boolean;
|
||||
hadTrumpHandoff?: boolean;
|
||||
team?: Team;
|
||||
foxesCaught?: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user