private void ScorePreferencesAndLoyalty() { foreach (PlayerBase player in this.Players) { PublicBoard.SetUndesiredRestaurantOfTheWeek(player, _preferenceCards[player].Undesired); LoyaltyCard loyalty = _loyaltyCards[player]; int visitsToLoyalty = 0; foreach (DayOfWeek day in Extensions.Weekdays) { if (PublicBoard.VisitedPlaces[player][day] is RestaurantPlace && (PublicBoard.VisitedPlaces[player][day] as RestaurantPlace).Identifier == loyalty.Restaurant) { visitsToLoyalty++; } if (PublicBoard.RestaurantWithMajority(day) == _preferenceCards[player].FirstPreference && PublicBoard.IsPlayerInMajority(day, player)) { PublicBoard.AddVictoryPointsToPlayer(_preferenceCards[player].FirstPreferenceBonus, player, VictoryPointsSource.PreferenceCard); } if (PublicBoard.RestaurantWithMajority(day) == _preferenceCards[player].SecondPreference && PublicBoard.IsPlayerInMajority(day, player)) { PublicBoard.AddVictoryPointsToPlayer(_preferenceCards[player].SecondPreferenceBonus, player, VictoryPointsSource.PreferenceCard); } if (PublicBoard.Restaurants[_preferenceCards[player].Undesired].Visitors[day].Contains(player)) { ApplyPunishment(_preferenceCards[player].Punishment, player); } if (PublicBoard.IsPlayerAlone(day, player.Left)) { ApplyPunishment(_preferenceCards[player].SideBan, player.Left); } if (PublicBoard.IsPlayerAlone(day, player.Right)) { ApplyPunishment(_preferenceCards[player].SideBan, player.Right); } } PublicBoard.AddVictoryPointsToPlayer(loyalty.VictoryPoints[visitsToLoyalty], player, VictoryPointsSource.LoyaltyCard); switch (_loyaltyCards[player].Type) { case LoyaltyType.VIP: LoyaltyCardVIP cardVIP = _loyaltyCards[player] as LoyaltyCardVIP; if (visitsToLoyalty >= 2) { List <int> desserts = player.ChooseDessert(PublicBoard, DessertBuffet.TakeChoices(cardVIP.DessertOptions), cardVIP.DessertTakeCount); List <DessertCard> chosenCards = this.DessertBuffet.RemoveDessertAtIndexes(desserts); _dessertCards[player].AddRange(chosenCards); } break; case LoyaltyType.GOLD: LoyaltyCardGOLD cardGOLD = _loyaltyCards[player] as LoyaltyCardGOLD; if (visitsToLoyalty >= 3) { PublicBoard.AddCashToPlayer(cardGOLD.ExtraCash, player); } break; } } }