예제 #1
0
 public DirectProducer(int bufferSize, int produceAmount, Item item)
 {
     _buffer            = new ItemBuffer(bufferSize, item);
     _items             = new[] { item };
     _item              = item;
     this.ProduceAmount = produceAmount;
 }
예제 #2
0
        public ItemBuffer GetBuffer(Item item)
        {
            _buffers.TryGetValue(item, out ItemBuffer? buffer);

            if (buffer == null)
            {
                buffer         = new ItemBuffer(1000, item);
                _buffers[item] = buffer;
            }

            return(buffer);
        }