Exemple #1
0
    public Inventory(InventoryGlob inventorySaveGlob) : base(SIZE)
    {
        TotalCost = 0;

        SetupItem setupItem;

        for (int i = 0; i < SIZE; ++i)
        {
            SetupItemsDictionary.TryGetItem(inventorySaveGlob.itemSlots[i].itemID, out setupItem);
            data[i]    = new ItemSlot(setupItem, inventorySaveGlob.itemSlots[i].quantity);
            TotalCost += (int)data[i].GetValue();
        }
    }
    private void LoadData()
    {
        //  Load rare item data
        RareItemDB.Load(ProgramControl.Options.GetOption(OptionData.OptionNames.RSVersion) as RSVersionOption);

        //  Load boss info
        bossInfoDictionary.Load(ProgramControl.Options.GetOptionValue(RSVersionOption.Name()));

        //  Load bosslog dictionary
        bossLogsDictionary.Load(bossInfoDictionary.GetBossIDs());

        SetupItemsDictionary.Setup(sheetID);
    }
    public Equipment(EquipmentGlob equipmentSaveGlob) : base(SIZE)
    {
        TotalCost = 0;

        SetupItem setupItem;

        for (int i = 0; i < SIZE; ++i)
        {
            SetupItemsDictionary.TryGetItem(equipmentSaveGlob.itemSlots[i].itemID, out setupItem);
            setupItem.SetIsEquipped(true);
            data[i] = new ItemSlot(setupItem, equipmentSaveGlob.itemSlots[i].quantity);

            if (setupItem is AugmentedArmour || setupItem is AugmentedWeapon)
            {
                augmentedEquipmentIndexes.Add(i);
            }
        }
    }
    public PrefightItems(PrefightItemsGlob prefightItemsGlob) : base(SIZE)
    {
        TotalCost = 0;

        bool      emptyGlob = (prefightItemsGlob == null);
        SetupItem setupItem;

        for (int i = 0; i < SIZE; ++i)
        {
            if (emptyGlob)
            {
                data[i] = new ItemSlot(General.NullItem(), 1);
            }
            else
            {
                SetupItemsDictionary.TryGetItem(prefightItemsGlob.itemSlots[i].itemID, out setupItem);
                data[i]    = new ItemSlot(setupItem, prefightItemsGlob.itemSlots[i].quantity);
                TotalCost += (int)data[i].GetValue();
            }
        }
    }