Ejemplo n.º 1
0
        private static void UpdateFromImputedValues(
            AppEntity appEntity, int imputedMain, int imputedExtras, int imputedCompletionist, TtbRatios ratios, out bool imputationZero, out bool imputationMiss)
        {
            HandleOverridenTtb(appEntity, "main", appEntity.MainTtb, appEntity.MainTtbImputed, ref imputedMain);
            HandleOverridenTtb(appEntity, "extras", appEntity.ExtrasTtb, appEntity.ExtrasTtbImputed, ref imputedExtras);
            HandleOverridenTtb(appEntity, "completionist", appEntity.CompletionistTtb, appEntity.CompletionistTtbImputed, ref imputedCompletionist);

            if (imputedMain == 0 || imputedExtras == 0 || imputedCompletionist == 0)
            {
                imputationZero = true;
                FixImputationZeroes(appEntity, ratios, ref imputedMain, ref imputedExtras, ref imputedCompletionist);
            }
            else
            {
                imputationZero = false;
            }

            if (imputedMain > imputedExtras || imputedExtras > imputedCompletionist)
            {
                imputationMiss = true;
                FixImputationMiss(appEntity, ratios, ref imputedMain, ref imputedExtras, ref imputedCompletionist);
            }
            else
            {
                imputationMiss = false;
            }

            appEntity.FixTtbs(imputedMain, imputedExtras, imputedCompletionist);
        }