private static BitSkinsInventory ReadBitSkinsInventory(dynamic bitskinsInventoryD) { BitSkinsInventory bitSkinsInventory = null; if (bitskinsInventoryD != null) { dynamic items = bitskinsInventoryD.items; int? totalItems = bitskinsInventoryD.total_items ?? null; double?TotalPrice = bitskinsInventoryD.total_price ?? null; List <BitSkinsInventoryItem> bitSkinsInventoryItems = new List <BitSkinsInventoryItem>(); if (items != null) { foreach (dynamic item in items) { BitSkinsInventoryItem bitSkinsInventoryItem = ReadBitskinsInventoryItem(item); bitSkinsInventoryItems.Add(bitSkinsInventoryItem); } } bitSkinsInventory = new BitSkinsInventory(totalItems, TotalPrice, bitSkinsInventoryItems); } return(bitSkinsInventory); }
internal AccountInventory(SteamInventory steamInventory, BitSkinsInventory bitSkinsInventory, PendingWithdrawalFromBitskinsInventory pendingWithdrawalFromBitskinsInventory) { SteamInventory = steamInventory; BitSkinsInventory = bitSkinsInventory; PendingWithdrawalFromBitskinsInventory = pendingWithdrawalFromBitskinsInventory; }
private static AccountInventory ReadAccountInventory(string result) { dynamic responseServerD = JsonConvert.DeserializeObject(result); dynamic steamInventoryD = responseServerD.data.steam_inventory; dynamic bitskinsInventoryD = responseServerD.data.bitskins_inventory; dynamic pendingWithdrawalInventoryD = responseServerD.data.pending_withdrawal_from_bitskins; SteamInventory steamInventory = ReadSteamInventory(steamInventoryD); BitSkinsInventory bitSkinsInventory = ReadBitSkinsInventory(bitskinsInventoryD); PendingWithdrawalFromBitskinsInventory pendingWithdrawalFromBitskinsInventory = ReadPendingWithdrawalFromBitskinsInventory(pendingWithdrawalInventoryD); AccountInventory accountInventorys = new AccountInventory(steamInventory, bitSkinsInventory, pendingWithdrawalFromBitskinsInventory); return(accountInventorys); }