コード例 #1
0
    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());
    }
コード例 #2
0
    public void ProcessOneOffRequest(ConsumableRequest request)
    {
        ICard card = _creator.CreateByRequest(request);

        if (card != null)
        {
            CardProvide(card);
        }
    }
コード例 #3
0
 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);
     }
 }