示例#1
0
        private void AddUniqueItemsFrom <T>(List <T> items) where T : CatalogItemModel
        {
            var uniqueItems = items.Where(i => !AllItems.Any(a => a.Sku.Equals(i.Sku))).ToList();

            if (uniqueItems.Any())
            {
                AllItems.AddRange(uniqueItems);
            }
        }
示例#2
0
        private void HandleInventoryUpdate(Action callback)
        {
            AllItems.Clear();
            AllItems.AddRange(VirtualItems);
            AllItems.AddRange(Subscriptions);

            UpdateVirtualCurrencyBalanceEvent?.Invoke(Balance);
            UpdateItemsEvent?.Invoke(VirtualItems);
            UpdateSubscriptionsEvent?.Invoke(Subscriptions);
            RefreshEvent?.Invoke();
            callback?.Invoke();
        }
        private void LoadItems(string[] fileNames)
        {
            foreach (var file in fileNames)
            {
                var toAdd = LoadJsonFile(file);

                if (toAdd != null)
                {
                    AllItems.AddRange(toAdd);
                }
            }
        }
示例#4
0
    private IEnumerator UpdateVirtualCurrenciesCoroutine(Action <Error> onError = null)
    {
        var busy = true;

        _demoImplementation.GetCatalogVirtualCurrencies(items =>
        {
            Currencies = items;
            AllItems.AddRange(items);
            UpdateVirtualCurrenciesEvent?.Invoke(items);
            busy = false;
        }, onError);
        yield return(new WaitWhile(() => busy));
    }
示例#5
0
文件: Form1.cs 项目: fel88/ATree
        public void SampleTree()
        {
            AItem Root = new AItem()
            {
                Name = "Happy life"
            };

            Root.AddChild(new AItem()
            {
                Name = "child1", Position = new PointF(200, 0), Progress = 45, IsProgress = true
            });

            AllItems.Add(Root);
            AllItems.AddRange(Root.Childs);
        }
示例#6
0
        public Inventory(List <byte> gameStateByteArray, DataOvlReference dataOvlRef)
        {
            this.gameStateByteArray = gameStateByteArray;

            DataChunk.CreateDataChunk(DataChunk.DataFormatType.Byte, "Grapple", gameStateByteArray, 0x209, sizeof(byte));
            DataChunk.CreateDataChunk(DataChunk.DataFormatType.Byte, "Magic Carpet", gameStateByteArray, 0x20A, sizeof(byte));

            ProtectiveArmour = new Armours(dataOvlRef, gameStateByteArray);
            AllItems.AddRange(ProtectiveArmour.GenericItemList);
            ReadyItems.AddRange(ProtectiveArmour.GenericItemList);

            TheWeapons = new Weapons(dataOvlRef, gameStateByteArray);
            ReadyItems.AddRange(TheWeapons.GenericItemList);

            MagicScrolls = new Scrolls(dataOvlRef, gameStateByteArray);
            UseItems.AddRange(MagicScrolls.GenericItemList);

            MagicPotions = new Potions(dataOvlRef, gameStateByteArray);
            UseItems.AddRange(MagicPotions.GenericItemList);

            SpecializedItems = new SpecialItems(dataOvlRef, gameStateByteArray);
            AllItems.AddRange(SpecializedItems.GenericItemList);
            UseItems.AddRange(SpecializedItems.GenericItemList);

            Artifacts = new LordBritishArtifacts(dataOvlRef, gameStateByteArray);
            AllItems.AddRange(Artifacts.GenericItemList);
            UseItems.AddRange(Artifacts.GenericItemList);

            Shards = new ShadowlordShards(dataOvlRef, gameStateByteArray);
            AllItems.AddRange(Shards.GenericItemList);
            UseItems.AddRange(Shards.GenericItemList);

            SpellReagents = new Reagents(dataOvlRef, gameStateByteArray);
            AllItems.AddRange(SpellReagents.GenericItemList);

            MagicSpells = new Spells(dataOvlRef, gameStateByteArray);
            AllItems.AddRange(MagicSpells.GenericItemList);
        }