public static void DeregisterAirNet(AirNet oldNet) { #if DEBUG Log.Message("RedistHeat: Deregistering " + oldNet); #endif allNets[oldNet.LayerInt].Remove(oldNet); AirNetGrid.NotifyNetDeregistered(oldNet); }
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 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; } } }
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; } } }
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 }
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; } } }
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; } } }
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; }
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 ); }