Refactoring score calculation logic

This commit is contained in:
2022-09-14 21:58:31 +02:00
parent 051657ef65
commit 753e490c29
5 changed files with 139 additions and 41 deletions
@@ -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 = '';