public static void PowerUpdateCurrentChange(IElectricityIO Supply)
 {
     Supply.FlushSupplyAndUp(Supply.GameObject());
     if (Supply.connectedDevices.Count > 0)
     {
         if (Supply.Data.SupplyingCurrent != 0)
         {
             Supply.ElectricityOutput(ElectricalSynchronisation.currentTick, Supply.Data.SupplyingCurrent, Supply.GameObject());
         }
     }
 }
Esempio n. 2
0
 public void PassOnFlushSupplyAndUp(IElectricityIO ComingFrom, GameObject SourceInstance = null)
 {
     if (ComingFrom == TheStart)
     {
         TheEnd.FlushSupplyAndUp(SourceInstance);
     }
     else if (ComingFrom == TheEnd)
     {
         TheStart.FlushSupplyAndUp(SourceInstance);
     }
 }
Esempio n. 3
0
 public static void PowerUpdateCurrentChange(IElectricityIO Supply)
 {
     Supply.FlushSupplyAndUp(Supply.GameObject());
     if (Supply.connectedDevices.Count > 0)
     {
         if (Supply.Data.SupplyingCurrent != 0)
         {
             Supply.ElectricityOutput(Supply.Data.SupplyingCurrent, Supply.GameObject());
         }
         else if (Supply.Data.SupplyingVoltage != 0)
         {
             int SourceInstanceID = Supply.GameObject().GetInstanceID();
             Supply.ElectricityOutput((Supply.Data.SupplyingVoltage) / (Supply.Data.InternalResistance + ElectricityFunctions.WorkOutResistance(Supply.Data.ResistanceComingFrom[SourceInstanceID])), Supply.GameObject());
         }
     }
 }