public static void GeneralDbUpdate(PlayerEntry player, IRating currentPlayer, ObservableCollection <PlayerEntry> players, bool isBestWay, bool redWin, bool blackWin, bool techRedWin, bool techBlackWin, ObservableCollection <int?> ugadaykaContainer, bool ugadaykaOn, bool threeZv, int prohBal, bool writeAcchievements, bool falseCom) { var path = $@"{Directory.GetCurrentDirectory()}\Rating Acchievements.txt"; currentPlayer.Games += 1; currentPlayer.Score += player.Result; if (player.Reflection != null && player.Reflection > 0) { currentPlayer.BestPlayer = currentPlayer.BestPlayer.Increment(); } if (isBestWay && player.PositionInKillQueue == 1) { currentPlayer.BestChoice = currentPlayer.BestChoice.Increment(); } if (falseCom) { currentPlayer.FalseCom = currentPlayer.FalseCom.Increment(); } if (redWin && player.IsRedTeam() || blackWin && player.IsBlackTeam()) { currentPlayer.Win = currentPlayer.Win.Increment(); currentPlayer.WinRow = currentPlayer.WinRow.Increment(); if (falseCom) { currentPlayer.FalseComWin = currentPlayer.FalseComWin.Increment(); } } if (techRedWin && player.IsRedTeam()) { currentPlayer.TechRed = currentPlayer.TechRed.Increment(); } if (techBlackWin && player.IsBlackTeam()) { currentPlayer.TechBlack = currentPlayer.TechBlack.Increment(); } if (redWin && player.IsBlackTeam() || blackWin && player.IsRedTeam()) { currentPlayer.Lose = currentPlayer.Lose.Increment(); currentPlayer.WinRow = 0; if (falseCom) { currentPlayer.FalseComLose = currentPlayer.FalseComLose.Increment(); } } if (ugadaykaContainer.Contains(players.IndexOf(player) + 1) && player.IsRedTeam() && redWin && ugadaykaOn) { currentPlayer.RedUgadayka = currentPlayer.RedUgadayka.Increment(); } if (ugadaykaContainer.Contains(players.IndexOf(player) + 1) && player.IsBlackTeam() && blackWin && ugadaykaOn) { currentPlayer.BlackUgadayka = currentPlayer.BlackUgadayka.Increment(); } if (blackWin && player.Role == GetLocalized("Don")) { currentPlayer.WinDon = currentPlayer.WinDon.Increment(); } if (redWin && player.Role == GetLocalized("Sheriff")) { currentPlayer.WinSheriff = currentPlayer.WinSheriff.Increment(); } if (redWin && player.Role == GetLocalized("Red")) { currentPlayer.WinRed = currentPlayer.WinRed.Increment(); } if (blackWin && player.Role == GetLocalized("Black")) { currentPlayer.WinBlack = currentPlayer.WinBlack.Increment(); } if (redWin && player.Role == GetLocalized("Don")) { currentPlayer.LoseDon = currentPlayer.LoseDon.Increment(); } if (blackWin && player.Role == GetLocalized("Sheriff")) { currentPlayer.LoseSheriff = currentPlayer.LoseSheriff.Increment(); } if (redWin && player.Role == GetLocalized("Black")) { currentPlayer.LoseBlack = currentPlayer.LoseBlack.Increment(); } if (blackWin && player.Role == GetLocalized("Red")) { currentPlayer.LoseRed = currentPlayer.LoseRed.Increment(); } if (player.Foul != null && player.Foul != 0) { currentPlayer.Fouls = currentPlayer.Fouls == null ? player.Foul : currentPlayer.Fouls += player.Foul; currentPlayer.WithoutFouls = 0; } else { currentPlayer.WithoutFouls = currentPlayer.WithoutFouls.Increment(); } if (player.PositionInKillQueue == 1) { currentPlayer.KilledAtFirstDay = currentPlayer.KilledAtFirstDay.Increment(); } if (player.CheckedAtNight == 1) { currentPlayer.CheckedFirst = currentPlayer.CheckedFirst.Increment(); } if (player.CheckedAtNight == 2) { currentPlayer.CheckedSecond = currentPlayer.CheckedSecond.Increment(); } if (threeZv && player.Role == GetLocalized("Sheriff")) { currentPlayer.ThreeZv = currentPlayer.ThreeZv.Increment(); } if (player.Foul == 4) { currentPlayer.Ban = currentPlayer.Ban.Increment(); } if (currentPlayer.WinRow == 5) { currentPlayer.Score += 1; if (writeAcchievements) { using (var sw = new StreamWriter(path, true)) { sw.WriteLine($"{DateTime.Now.ToShortDateString()}. {currentPlayer.Nick} - Combo Win"); sw.Close(); } } } if (currentPlayer.WinRow == 10) { if (currentPlayer.Score != null) { currentPlayer.Score += 3; } if (writeAcchievements) { using (var sw = new StreamWriter(path, true)) { sw.WriteLine($"{DateTime.Now.ToShortDateString()}. {currentPlayer.Nick} - Epic Win"); sw.Close(); } } } if (currentPlayer.WinRow > 10) { if (currentPlayer.Score != null) { currentPlayer.Score += (double)currentPlayer.WinRow / 20; } if (writeAcchievements) { using (var sw = new StreamWriter(path, true)) { sw.WriteLine($"{DateTime.Now.ToShortDateString()}. {currentPlayer.Nick} - Win series {currentPlayer.WinRow}"); sw.Close(); } } } if (currentPlayer.WithoutFouls == 10 && writeAcchievements) { using (var sw = new StreamWriter(path, true)) { sw.WriteLine($"{DateTime.Now.ToShortDateString()}. {currentPlayer.Nick} - Epic Without Fouls"); sw.Close(); } } if (currentPlayer.Games >= prohBal) { currentPlayer.Rating = currentPlayer.Score / currentPlayer.Games * 100; if (currentPlayer.Rating != null) { currentPlayer.Rating = Math.Round((double)currentPlayer.Rating, 3); } } else { currentPlayer.Rating = null; } }