Exemplo n.º 1
0
    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 override void Initialize()
    {
        //IL_00b0: Unknown result type (might be due to invalid IL or missing references)
        object[] array = GameSection.GetEventData() as object[];
        materialData = (array[0] as ProductData);
        priceStr     = (array[1] as string);
        index        = (int)array[2];
        InventoryList <ItemInfo, Item> inventoryList = ItemInfo.CreateList(materialData.items);

        datas = new List <ItemSortData>();
        for (LinkedListNode <ItemInfo> linkedListNode = inventoryList.GetFirstNode(); linkedListNode != null; linkedListNode = linkedListNode.Next)
        {
            if (linkedListNode != null && linkedListNode.Value != null && linkedListNode.Value.tableData != null)
            {
                ItemSortData itemSortData = new ItemSortData();
                itemSortData.SetItem(linkedListNode.Value);
                datas.Add(itemSortData);
            }
        }
        this.StartCoroutine(DoInitialize());
    }