コード例 #1
0
        public void TransferBufferToContainer(Reagent reagent, float amount)
        {
            ReagentMix tempTransfer = GetBufferMix();

            //Container never gets swapped without clearing buffer, so we can assume there's space in container
            tempTransfer.Remove(reagent, amount);
            Container.CurrentReagentMix.Add(reagent, amount);

            TransferMixToBuffer(tempTransfer);

            UpdateGui();
        }
コード例 #2
0
        public void RemoveFromBuffer(Reagent reagent, float amount)
        {
            ReagentMix tempTransfer = GetBufferMix();

            //one removal, no math
            tempTransfer.Remove(reagent, amount);

            //part two of transfer: fill Buffer from tempTransfer Mix
            TransferMixToBuffer(tempTransfer);

            UpdateGui();
        }
コード例 #3
0
ファイル: ChemMaster.cs プロジェクト: ktndrnl/unitystation
        public void RemoveFromBuffer(Reagent reagent, float amount)
        {
            ReagentMix tempTransfer = GetBufferMix();

            //one removal, no math
            tempTransfer.Remove(reagent, amount);
            //remove listing if empty
            if (tempTransfer.reagents[reagent] <= 0)
            {
                tempTransfer.reagentKeys.Remove(reagent);
            }

            //part two of transfer: fill Buffer from tempTransfer Mix
            TransferMixToBuffer(tempTransfer);

            UpdateGui();
        }
コード例 #4
0
ファイル: ChemMaster.cs プロジェクト: ktndrnl/unitystation
        public void TransferBufferToContainer(Reagent reagent, float amount)
        {
            ReagentMix tempTransfer = GetBufferMix();

            //Container never gets swapped without clearing buffer, so we can assume there's space in container
            tempTransfer.Remove(reagent, amount);
            Container.CurrentReagentMix.Add(reagent, amount);

            //remove listing if empty
            if (tempTransfer.reagents[reagent] <= 0)
            {
                lock (tempTransfer.reagents)
                {
                    tempTransfer.reagents.m_dict.Remove(reagent);
                }
            }

            TransferMixToBuffer(tempTransfer);

            UpdateGui();
        }