Пример #1
0
        /// <summary>
        /// Updates the sim with changes to a building's attributes.
        /// </summary>
        /// <param name="payload">The building to modify.</param>
        private static void UpdateSimState(ref StructureTemperaturePayload payload)
        {
            var   def  = payload.building.Def;
            float mass = def.MassForTemperatureModification;
            float overheatTemperature = (payload.overheatable != null) ? payload.overheatable.
                                        OverheatTemperature : Sim.MaxTemperature;

            if (!payload.enabled || payload.bypass)
            {
                mass = 0.0f;
            }
            SimMessages.ModifyBuildingHeatExchange(payload.simHandleCopy, payload.GetExtents(),
                                                   mass, payload.primaryElement.InternalTemperature, def.ThermalConductivity,
                                                   overheatTemperature, payload.OperatingKilowatts, payload.primaryElement.
                                                   Element.idx);
        }