Exemple #1
0
        public void Initialize()
        {
            var baseInfo = _configRepository.GetItemConfig();

            if (_baseInfo != null && _baseInfo.Equals(baseInfo))
            {
                return;
            }

            _baseInfo = baseInfo;
            _equipmentFactory.Initialize(baseInfo.ItemBase, baseInfo.Category, baseInfo.ItemLevel);
            _itemBase = _equipmentFactory.GetBaseItem();
            _affixes  = new ObservableCollection <Affix>(_equipmentFactory.GetPossibleAffixes());

            CraftingTree.ClearConditions();
            CraftingTree.Initialize();
            Condition = null;
            _selected = Tree.Tree[0].Value;
            Tree.UpdateTree(CraftingTree, _selected);
            OnPropertyChanged(nameof(Condition));
            OnPropertyChanged(nameof(Tree));
        }
Exemple #2
0
        private void OnNextClick(object sender, RoutedEventArgs e)
        {
            if (_currentControlIndex >= _controls.Count - 1)
            {
                return;
            }

            _controls[_currentControlIndex].OnClose();
            _currentControlIndex++;

            SelectedStep = _controls[_currentControlIndex] as ContentControl;
            OnPropertyChanged(nameof(SelectedStep));


            if (_controls[_currentControlIndex] == ItemList)
            {
                var baseInfo = BaseSelection.BaseInformation;
                var affixes  = _equipmentFactory.GetPossibleAffixes();
                var baseItem = _equipmentFactory.GetBaseItem();

                ItemList.Initialize(affixes, baseItem, baseInfo);
            }
            else if (_controls[_currentControlIndex] == Crafting)
            {
                var itemList = ItemList.ItemPrototypes.ToList();

                Crafting.Initialize(null, _equipmentFactory, _currencyFactory, itemList, BaseSelection.ItemCost);
            }
            else if (_controls[_currentControlIndex] == Results)
            {
                var currencySpent = -1;
                Results.Initialize(Crafting.MatchingItems, currencySpent);
            }

            OnPropertyChanged(nameof(IsReady));
        }