public static InventoryList <SkillItemInfo, SkillItem> CreateListFromItemInventory(InventoryList <ItemInfo, Item> itemInventory) { InventoryList <SkillItemInfo, SkillItem> inventoryList = new InventoryList <SkillItemInfo, SkillItem>(); for (LinkedListNode <ItemInfo> linkedListNode = itemInventory.GetFirstNode(); linkedListNode != null; linkedListNode = linkedListNode.Next) { ItemInfo value = linkedListNode.Value; if (value.tableData.type == ITEM_TYPE.MATERIAL_MAGI && value.GetNum() > 0) { SkillItem skillItem = new SkillItem(); skillItem.uniqId = value.uniqueID.ToString(); skillItem.skillItemId = (int)value.tableData.id; skillItem.level = 1; inventoryList.Add(skillItem); inventoryList.GetLastNode().Value.num = value.GetNum(); inventoryList.GetLastNode().Value.itemId = value.tableData.id; } } return(inventoryList); }
public static InventoryList <SkillItemInfo, SkillItem> CreateListFromItem(List <Item> recv_list) { InventoryList <SkillItemInfo, SkillItem> list = new InventoryList <SkillItemInfo, SkillItem>(); recv_list.ForEach(delegate(Item o) { ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData((uint)o.itemId); if (itemData.type == ITEM_TYPE.MATERIAL_MAGI && o.num > 0) { SkillItem item = new SkillItem { uniqId = o.uniqId, skillItemId = o.itemId, level = (XorInt)1 }; list.Add(item); list.GetLastNode().Value.num = o.num; list.GetLastNode().Value.itemId = (uint)o.itemId; } }); return(list); }