예제 #1
0
        internal static void ValidationRulesCheck(MechDef mechDef, ref Dictionary <MechValidationType, List <string> > errorMessages)
        {
            var calculator = new ArmorWeightSavingCalculator(mechDef);

            if (calculator.ErrorMessage != null)
            {
                errorMessages[MechValidationType.InvalidInventorySlots].Add(calculator.ErrorMessage);
            }
        }
예제 #2
0
        internal static void AdjustTooltip(TooltipPrefab_Equipment tooltip, MechLabPanel panel, MechComponentDef mechComponentDef)
        {
            if (!mechComponentDef.IsArmor())
            {
                return;
            }

            var calculator = new ArmorWeightSavingCalculator(panel.activeMechDef);
            var tonnage    = calculator.WeightSavings;

            tooltip.bonusesText.text = string.Format("- {0} ton,  {1} / {2}", tonnage, calculator.Count, calculator.RequiredCount);
        }
예제 #3
0
        internal static float WeightSavings(MechDef mechDef)
        {
            var calculator = new ArmorWeightSavingCalculator(mechDef);

            return(calculator.WeightSavings);
        }