public DirectProducer(int bufferSize, int produceAmount, Item item) { _buffer = new ItemBuffer(bufferSize, item); _items = new[] { item }; _item = item; this.ProduceAmount = produceAmount; }
public ItemBuffer GetBuffer(Item item) { _buffers.TryGetValue(item, out ItemBuffer? buffer); if (buffer == null) { buffer = new ItemBuffer(1000, item); _buffers[item] = buffer; } return(buffer); }