Пример #1
0
        public static void DeregisterAirNet(AirNet oldNet)
        {
#if DEBUG
            Log.Message("RedistHeat: Deregistering " + oldNet);
#endif
            allNets[oldNet.LayerInt].Remove(oldNet);
            AirNetGrid.NotifyNetDeregistered(oldNet);
        }
Пример #2
0
        public static void RegisterAirNet(AirNet newNet)
        {
#if DEBUG
            Log.Message("RedistHeat: Registering " + newNet);
#endif
            allNets[newNet.LayerInt].Add(newNet);
            AirNetGrid.NotifyNetCreated(newNet);
        }
Пример #3
0
 public static void NotifyNetDeregistered(AirNet oldNet)
 {
     foreach (var node in oldNet.nodes)
     {
         //For every cell occupied by a node
         var occupiedRect = node.parent.OccupiedRect();
         foreach (var current in occupiedRect)
         {
             //Delete the cell's registered net
             netGrid[oldNet.LayerInt][CellIndices.CellToIndex(current)] = null;
         }
     }
 }
Пример #4
0
 public static void NotifyNetCreated(AirNet newNet)
 {
     foreach (var node in newNet.nodes)
     {
         //For every cell occupied by a node
         var occupiedRect = node.parent.OccupiedRect();
         foreach (var current in occupiedRect)
         {
             //Register the cell as the new net
             netGrid[newNet.LayerInt][CellIndices.CellToIndex(current)] = newNet;
         }
     }
 }
Пример #5
0
        public static void Reinit()
        {
            var layerCount = Common.NetLayerCount();
            netGrid = new AirNet[layerCount][];

            for (var i = 0; i < layerCount; i++)
            {
                netGrid[i] = new AirNet[CellIndices.NumGridCells];
            }
            #if DEBUG
            Log.Message( "LT-RH: Initialized AirNetGrid." );
            #endif
        }
Пример #6
0
 public static void NotifyNetDeregistered( AirNet oldNet )
 {
     foreach (var node in oldNet.nodes)
     {
         //For every cell occupied by a node
         var occupiedRect = node.parent.OccupiedRect();
         foreach (var current in occupiedRect)
         {
             //Delete the cell's registered net
             netGrid[oldNet.LayerInt][CellIndices.CellToIndex( current )] = null;
         }
     }
 }
Пример #7
0
 public static void NotifyNetCreated( AirNet newNet )
 {
     foreach (var node in newNet.nodes)
     {
         //For every cell occupied by a node
         var occupiedRect = node.parent.OccupiedRect();
         foreach (var current in occupiedRect)
         {
             //Register the cell as the new net
             netGrid[newNet.LayerInt][CellIndices.CellToIndex( current )] = newNet;
         }
     }
 }
Пример #8
0
        public static void Reinit()
        {
            var layerCount = Common.NetLayerCount();

            netGrid = new AirNet[layerCount][];

            for (var i = 0; i < layerCount; i++)
            {
                netGrid[i] = new AirNet[CellIndices.NumGridCells];
            }
#if DEBUG
            Log.Message("RedistHeat: Initialized AirNetGrid.");
#endif
        }
 private static float ControlTemperatureTempChange( AirNet net, float energyLimit, float targetTemperature )
 {
     var b = energyLimit/net.nodes.Count;
     var a = targetTemperature - net.NetTemperature;
     float num;
     if (energyLimit > 0f)
     {
         num = Mathf.Min( a, b );
         num = Mathf.Max( num, 0f );
     }
     else
     {
         num = Mathf.Max( a, b );
         num = Mathf.Min( num, 0f );
     }
     return num;
 }
Пример #10
0
        private static float ControlTemperatureTempChange(AirNet net, float energyLimit, float targetTemperature)
        {
            var   b = energyLimit / net.nodes.Count;
            var   a = targetTemperature - net.NetTemperature;
            float num;

            if (energyLimit > 0f)
            {
                num = Mathf.Min(a, b);
                num = Mathf.Max(num, 0f);
            }
            else
            {
                num = Mathf.Max(a, b);
                num = Mathf.Min(num, 0f);
            }
            return(num);
        }
 public static void RegisterAirNet( AirNet newNet )
 {
     #if DEBUG
     Log.Message("RedistHeat: Registering " + newNet );
     #endif
     allNets[newNet.LayerInt].Add( newNet );
     AirNetGrid.NotifyNetCreated( newNet );
 }
 public static void DeregisterAirNet( AirNet oldNet )
 {
     #if DEBUG
     Log.Message("RedistHeat: Deregistering " + oldNet );
     #endif
     allNets[oldNet.LayerInt].Remove( oldNet );
     AirNetGrid.NotifyNetDeregistered( oldNet );
 }