コード例 #1
0
        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;
            }
        }
コード例 #2
0
 public void SetTransferAmount(FixedPoint2 amount)
 {
     amount = FixedPoint2.New(Math.Clamp(amount.Int(), MinimumTransferAmount.Int(),
                                         MaximumTransferAmount.Int()));
     TransferAmount = amount;
 }
コード例 #3
0
 public void SetTransferAmount(ReagentUnit amount)
 {
     amount = ReagentUnit.New(Math.Clamp(amount.Int(), MinimumTransferAmount.Int(),
                                         MaximumTransferAmount.Int()));
     TransferAmount = amount;
 }