Пример #1
0
 private static Statistics Operate(Statistics stats, int i, Func <int, int, int> operation) => Operate(stats, null, i, operation);
Пример #2
0
 private static Statistics Operate(Statistics first, Statistics second, Func <int, int, int> operation) => Operate(first, second, 0, operation);
Пример #3
0
        public static double AccountWN8(Dictionary <int, ExpectedValues> expectedValues, Dictionary <int, Statistics> tankStats, out Statistics cumulatedStats)
        {
            cumulatedStats = new Statistics();
            ExpectedValues cumulatedExpected = new ExpectedValues();

            foreach (var pair in tankStats)
            {
                if (expectedValues.TryGetValue(pair.Key, out ExpectedValues values))
                {
                    cumulatedExpected += values * pair.Value.Battles;
                    cumulatedStats    += pair.Value;
                }
            }
            cumulatedExpected /= cumulatedStats.Battles;
            return(Calculate(cumulatedStats, cumulatedExpected));
        }
Пример #4
0
 public static double AccountWN8(IExpectedValueList expectedValueList, string version, Dictionary <int, Statistics> tankStats, out Statistics cumulatedStats)
 {
     return(AccountWN8(expectedValueList[version], tankStats, out cumulatedStats));
 }
Пример #5
0
 public static double EstimatedAccountWN8Newest(IExpectedValueList expectedValueList, WinrateRecord[] winrateRecords, Statistics cumulatedStats)
 {
     return(EstimatedAccountWN8(expectedValueList, expectedValueList.Versions.Max(), winrateRecords, cumulatedStats));
 }
Пример #6
0
        public static double EstimatedAccountWN8(IExpectedValueList expectedValueList, string version, WinrateRecord[] winrateRecords, Statistics cumulatedStats)
        {
            Dictionary <int, ExpectedValues> expectedValues = expectedValueList[version];
            ExpectedValues cumulatedExpected = new ExpectedValues();

            foreach (var winrateRecord in winrateRecords)
            {
                if (expectedValues.TryGetValue(winrateRecord.TankID, out ExpectedValues values))
                {
                    cumulatedExpected += values * winrateRecord.Battles;
                }
            }
            cumulatedExpected /= cumulatedStats.Battles;
            return(Calculate(cumulatedStats, cumulatedExpected));
        }