Пример #1
0
        internal static void ValidationRulesCheck(MechDef mechDef, ref Dictionary <MechValidationType, List <string> > errorMessages)
        {
            var calculator = new StructureWeightSavingCalculator(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.IsStructure())
            {
                return;
            }

            var calculator = new StructureWeightSavingCalculator(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 StructureWeightSavingCalculator(mechDef);

            return(calculator.WeightSavings);
        }