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); }
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); }
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); }
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)); }