private void UpdateEmitter(MassTestChamber master, int deltaTime) { int direction = master.SimulationInput.PollInteger(MassTestChamber.EmitterMotorKey); if (direction != 0) { EmitterCart.Drive(direction > 0, deltaTime); } bool emitting = master.SimulationInput.PollBoolean(MassTestChamber.EmitterKey); if (emitting) { bool field = master.SimulationInput.PollBoolean(MassTestChamber.FieldGeneratorKey); bool focusOn = master.SimulationInput.PollBoolean(MassTestChamber.FocusKey); bool focusValid = FocusCart.FrontPositionReached && focusOn; Emitter.ShowAsActiveWith(EmitterCart, field, focusValid); } else { Emitter.ShowAsOff(EmitterCart); } master.SimulationOutput.SetValue(MassTestChamber.EmitterFrontKey, EmitterCart.FrontPositionReached); master.SimulationOutput.SetValue(MassTestChamber.EmitterBackKey, EmitterCart.BackPositionReached); }