public void UserInterfaceOnReceiveMessage(ServerBoundUserInterfaceMessage serverMsg)
        {
            switch (serverMsg.Message)
            {
            case TransferAmountSetValueMessage svm:
                var sval   = svm.Value.Float();
                var amount = Math.Clamp(sval, MinimumTransferAmount.Float(),
                                        MaximumTransferAmount.Float());

                serverMsg.Session.AttachedEntity?.PopupMessage(Loc.GetString("comp-solution-transfer-set-amount",
                                                                             ("amount", amount)));
                SetTransferAmount(ReagentUnit.New(amount));
                break;
            }
        }
 public void SetTransferAmount(FixedPoint2 amount)
 {
     amount = FixedPoint2.New(Math.Clamp(amount.Int(), MinimumTransferAmount.Int(),
                                         MaximumTransferAmount.Int()));
     TransferAmount = amount;
 }
 public void SetTransferAmount(ReagentUnit amount)
 {
     amount = ReagentUnit.New(Math.Clamp(amount.Int(), MinimumTransferAmount.Int(),
                                         MaximumTransferAmount.Int()));
     TransferAmount = amount;
 }