コード例 #1
0
ファイル: Statistics.cs プロジェクト: Johny404/wg-api-wrapper
 private static Statistics Operate(Statistics stats, int i, Func <int, int, int> operation) => Operate(stats, null, i, operation);
コード例 #2
0
ファイル: Statistics.cs プロジェクト: Johny404/wg-api-wrapper
 private static Statistics Operate(Statistics first, Statistics second, Func <int, int, int> operation) => Operate(first, second, 0, operation);
コード例 #3
0
ファイル: WN8.cs プロジェクト: Johny404/wg-api-wrapper
        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
ファイル: WN8.cs プロジェクト: Johny404/wg-api-wrapper
 public static double AccountWN8(IExpectedValueList expectedValueList, string version, Dictionary <int, Statistics> tankStats, out Statistics cumulatedStats)
 {
     return(AccountWN8(expectedValueList[version], tankStats, out cumulatedStats));
 }
コード例 #5
0
ファイル: WN8.cs プロジェクト: Johny404/wg-api-wrapper
 public static double EstimatedAccountWN8Newest(IExpectedValueList expectedValueList, WinrateRecord[] winrateRecords, Statistics cumulatedStats)
 {
     return(EstimatedAccountWN8(expectedValueList, expectedValueList.Versions.Max(), winrateRecords, cumulatedStats));
 }
コード例 #6
0
ファイル: WN8.cs プロジェクト: Johny404/wg-api-wrapper
        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));
        }