public ICard CreateByRequest(ConsumableRequest request) { var builder = _creator.CreateBuilder <ConsumableCard, ConsumableCardArgs>(_consumableData); builder.Arguments.consumableData = request.Data; builder.Arguments.amount = request.Amount; return(builder.CreateCard()); }
public void ProcessOneOffRequest(ConsumableRequest request) { ICard card = _creator.CreateByRequest(request); if (card != null) { CardProvide(card); } }
private void SendRequests(Dictionary <ConsumableData, int> data) { foreach (KeyValuePair <ConsumableData, int> item in data) { if (item.Value <= 0) { continue; } var request = new ConsumableRequest() { Data = item.Key, Amount = item.Value }; _provider.ProcessOneOffRequest(request); } }