Ejemplo n.º 1
0
 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());
         }
     }
 }
Ejemplo n.º 2
0
 public void PassOnFlushSupplyAndUp(IElectricityIO ComingFrom, GameObject SourceInstance = null)
 {
     if (ComingFrom == TheStart)
     {
         TheEnd.FlushSupplyAndUp(SourceInstance);
     }
     else if (ComingFrom == TheEnd)
     {
         TheStart.FlushSupplyAndUp(SourceInstance);
     }
 }
Ejemplo 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());
         }
     }
 }