Ejemplo n.º 1
0
 public virtual float IOInput(IOEntity from, IOEntity.IOType inputType, float inputAmount, int slot = 0)
 {
     IOEntity.IOSlot[] oSlotArray = this.outputs;
     for (int i = 0; i < (int)oSlotArray.Length; i++)
     {
         IOEntity.IOSlot oSlot = oSlotArray[i];
         if (oSlot.connectedTo.Get(true) != null)
         {
             inputAmount = oSlot.connectedTo.Get(true).IOInput(this, oSlot.type, inputAmount, oSlot.connectedToSlot);
         }
     }
     return(inputAmount);
 }
Ejemplo n.º 2
0
 public override float IOInput(IOEntity from, IOEntity.IOType inputType, float inputAmount, int slot = 0)
 {
     if (inputAmount <= 0f)
     {
         this.NoEnergy();
         return(inputAmount);
     }
     this.AddEnergy(inputAmount);
     if (this.storedEnergy == this.energyForOpen)
     {
         return(inputAmount);
     }
     return(0f);
 }
Ejemplo n.º 3
0
 public virtual float IOInput(
     IOEntity from,
     IOEntity.IOType inputType,
     float inputAmount,
     int slot = 0)
 {
     foreach (IOEntity.IOSlot output in this.outputs)
     {
         if (Object.op_Inequality((Object)output.connectedTo.Get(true), (Object)null))
         {
             inputAmount = output.connectedTo.Get(true).IOInput(this, output.type, inputAmount, output.connectedToSlot);
         }
     }
     return(inputAmount);
 }
Ejemplo n.º 4
0
 public override float IOInput(IOEntity from, IOEntity.IOType inputType, float inputAmount, int slot = 0)
 {
     if (inputAmount < 0f)
     {
         this.SetRotateProgress(this.rotateProgress + inputAmount);
         base.SendNetworkUpdate(BasePlayer.NetworkQueue.Update);
     }
     if (inputType == IOEntity.IOType.Electric && slot == 1)
     {
         if (inputAmount != 0f)
         {
             base.InvokeRepeating(new Action(this.Powered), 0f, this.progressTickRate);
         }
         else
         {
             base.CancelInvoke(new Action(this.Powered));
         }
     }
     return(Mathf.Clamp(inputAmount - 1f, 0f, inputAmount));
 }