Example #1
0
 /// <summary>
 /// Update one of the loads from a deviceconnected to the powernet
 /// </summary>
 public void UpdateDevice(PowerDeviceComponent device, float oldLoad)
 {
     if (Deviceloadlist.Contains(device))
     {
         Load -= oldLoad;
         Load += device.Load;
     }
 }
Example #2
0
 /// <summary>
 /// Remove a continuous load from a device connected to the powernet
 /// </summary>
 public void RemoveDevice(PowerDeviceComponent device)
 {
     if (Deviceloadlist.Contains(device))
     {
         Load -= device.Load;
         Deviceloadlist.Remove(device);
         if (DepoweredDevices.Contains(device))
         {
             DepoweredDevices.Remove(device);
         }
     }
     else
     {
         var name = device.Owner.Prototype.Name;
         Logger.Log(String.Format("We tried to remove a device twice from the same powernet somehow, prototype {0}", name));
     }
 }