Пример #1
0
            public static bool Prefix(Wire.WattageRating rating, ref float __result)
            {
                if (rating < Wire.WattageRating.NumRatings)
                {
                    return(true);
                }

                switch (rating.ToExtendedWireWattageRating())
                {
                case WattageRating.Max1MW:
                    __result = 1e6f;
                    break;

                case WattageRating.Max1GW:
                    __result = 1e9f;
                    break;

                case WattageRating.Max5kW:
                    __result = 5e3f;
                    break;

                default:
                    __result = 0;
                    break;
                }

                return(false);
            }
Пример #2
0
 public static GameUtil.WattageFormatterUnit GetFormatterUnit(this Wire.WattageRating rating) => rating.ToExtendedWireWattageRating().GetFormatterUnit();