Exemplo n.º 1
0
        public static BankItemResponse GenBankItemResponseByPlayBank(PlayerBank playerBank, IEnumerable <int> itemId)
        {
            var items = playerBank.ItemsIdToNum.Where(a =>
                                                      itemId.Contains(a.Key)
                                                      ).Select(x => new Item {
                itemId = x.Key, Num = x.Value
            }).ToList();
            var bank = new BankItemResponse {
                Items = items
            };

            return(bank);
        }
Exemplo n.º 2
0
        public static BankItemResponse GenBankItemResponseByPlayBank(PlayerBank playerBank)
        {
            var items = playerBank.ItemsIdToNum
                        .Select(x => new Item()
            {
                itemId = x.Key, Num = x.Value
            }).ToList();

            var bank = new BankItemResponse {
                Items = items
            };

            return(bank);
        }