Exemple #1
0
 public override void ResistancyOutput(ResistanceWrap Resistance, ElectricalOIinheritance SourceInstance)
 {
     Resistance = InData.ControllingDevice.ModifyResistancyOutput(Resistance, SourceInstance);
     if (Logall)
     {
         Logger.Log("this > " + this + "ResistancyOutput, Resistance > " + Resistance + " SourceInstance  > " + SourceInstance, Category.Electrical);
     }
     InputOutputFunctions.ResistancyOutput(Resistance, SourceInstance, InData);
 }
Exemple #2
0
 /// <summary>
 /// Passes it on to the next cable
 /// </summary>
 public virtual void ResistancyOutput(ResistanceWrap Resistance, ElectricalOIinheritance SourceInstance)
 {
     if (Logall)
     {
         Logger.Log("this > " + this
                    + "ResistancyOutput, Resistance > " + Resistance
                    + " SourceInstance  > " + SourceInstance, Category.Electrical);
     }
     InputOutputFunctions.ResistancyOutput(Resistance, SourceInstance, InData);
 }
Exemple #3
0
 /// <summary>
 /// Passes it on to the next cable
 /// </summary>
 public virtual void ResistancyOutput(ResistanceWrap Resistance, ElectricalOIinheritance SourceInstance)
 {
     if (Present != null)
     {
         Present.ResistancyOutput(Resistance, SourceInstance);
     }
     else
     {
         InputOutputFunctions.ResistancyOutput(Resistance, SourceInstance, this);
     }
 }
Exemple #4
0
 /// <summary>
 /// Pass resistance with GameObject of the Machine it is heading toward
 /// </summary>
 public virtual void ResistanceInput(ResistanceWrap Resistance,
                                     ElectricalOIinheritance SourceInstance,
                                     IntrinsicElectronicData ComingFrom)
 {
     if (Logall)
     {
         Logger.Log("this > " + this
                    + "ResistanceInput, Resistance > " + Resistance
                    + " SourceInstance  > " + SourceInstance
                    + " ComingFrom > " + ComingFrom, Category.Electrical);
     }
     InputOutputFunctions.ResistanceInput(Resistance, SourceInstance, ComingFrom, InData);
 }
Exemple #5
0
 /// <summary>
 /// Pass resistance with GameObject of the Machine it is heading toward
 /// </summary>
 public virtual void ResistanceInput(ResistanceWrap Resistance,
                                     ElectricalOIinheritance SourceInstance,
                                     IntrinsicElectronicData ComingFrom)
 {
     if (Present != null)
     {
         Present.ResistanceInput(Resistance, SourceInstance, ComingFrom);
     }
     else
     {
         InputOutputFunctions.ResistanceInput(Resistance, SourceInstance, ComingFrom, this);
     }
 }
        public void AddResistance(ResistanceWrap resistance)
        {
            //return;

            /*foreach (var Resistancewrap in ResistanceSources) {
             *      //ResistanceSources.Add(resistance);
             *      //return;
             *      if (Resistancewrap.resistance == resistance.resistance) {
             *
             *              Resistancewrap.Strength = resistance.Strength;
             *              return;
             *      }
             * }*/
            ResistanceSources.Add(resistance);
        }
Exemple #7
0
        public static void ResistanceInput(ResistanceWrap Resistance,
                                           ElectricalOIinheritance SourceInstance,
                                           IntrinsicElectronicData ComingFrom,
                                           IntrinsicElectronicData Thiswire)
        {
            if (Thiswire.Data.SupplyDependent.TryGetValue(SourceInstance, out ElectronicSupplyData supplyDep))
            {
                if (!supplyDep.ResistanceComingFrom.TryGetValue(ComingFrom, out VIRResistances resComeFrom))
                {
                    resComeFrom = supplyDep.ResistanceComingFrom[ComingFrom] = ElectricalPool.GetVIRResistances();
                }

                resComeFrom.AddResistance(Resistance);
            }

            Thiswire.ResistancyOutput(Resistance, SourceInstance);
        }
Exemple #8
0
        public static void ResistancyOutput(ResistanceWrap Resistance,
                                            ElectricalOIinheritance SourceInstance,
                                            IntrinsicElectronicData Thiswire)
        {
            if (Thiswire.Data.SupplyDependent.TryGetValue(SourceInstance, out ElectronicSupplyData supplyDep))
            {
                foreach (var JumpTo in supplyDep.Upstream)
                {
                    if (!supplyDep.ResistanceGoingTo.TryGetValue(JumpTo, out VIRResistances resGoTo))
                    {
                        resGoTo = supplyDep.ResistanceGoingTo[JumpTo] = ElectricalPool.GetVIRResistances();
                    }

                    resGoTo.AddResistance(Resistance);
                    JumpTo.ResistanceInput(Resistance, SourceInstance, Thiswire);
                }
            }
        }
 public void SetUp(ResistanceWrap _ResistanceWrap)
 {
     resistance = _ResistanceWrap.resistance;
     Strength   = _ResistanceWrap.Strength;
 }