Beispiel #1
0
 public CraftingTestbedModel(EquipmentFactory factory, CurrencyFactory currencyFactory, EquipmentFetch equipmentFetch)
 {
     _equipmentFetch  = equipmentFetch;
     _factory         = factory;
     CurrencyFactory  = currencyFactory;
     ItemSubtypeNames = equipmentFetch.FetchSubtypes();
     Status           = new ItemStatus();
 }
        public ItemBaseViewModel(IItemConfigRepository configRepository, EquipmentFetch equipmentFetch, ItemConfig config)
        {
            this._configRepository = configRepository;
            base.DisplayName       = "Item Config";
            _equipmentFetch        = equipmentFetch;
            _itemTypeOptions       = _equipmentFetch.FetchSubtypes().ToArray();
            _config = new ItemConfig();

            ItemLevel = config.ItemLevel.ToString();
            ItemType  = config.ItemType;
            ItemBase  = config.ItemBase;
        }
Beispiel #3
0
 public BaseSelectionControl(EquipmentFetch fetch, EquipmentFactory factory)
 {
     _itemLevel       = 84;
     _fetch           = fetch;
     _factory         = factory;
     Subtypes         = fetch.FetchSubtypes().OrderBy(x => x).ToList();
     SelectedLeague   = Leagues[0];
     SelectedCategory = Categories[0];
     OnPropertyChanged(nameof(SelectedLeague));
     OnPropertyChanged(nameof(SelectedCategory));
     InitializeComponent();
     DataContext = this;
 }
        public WorkspaceFactory(
            IItemConfigRepository configRepository,
            EquipmentFetch equipmentFetch,
            CurrencyFactory currencyFactory,
            IRegionManager regionManager)
        {
            _configRepository = configRepository;
            _equipmentFetch   = equipmentFetch;
            _currencyFactory  = currencyFactory;
            _regionManager    = regionManager;

            _itemInput = new CommandViewModel(
                "Item Info",
                new DelegateCommand(() => Navigate(typeof(ItemBaseView).FullName)),
                () => true);

            _craftingProcess = new CommandViewModel(
                "Crafting Process",
                new DelegateCommand(() => Navigate(typeof(CraftingProcessView).FullName)),
                () => _configRepository.GetItemConfig().IsValid);

            _itemSelection = new CommandViewModel(
                "Item Selection",
                new DelegateCommand(() => Navigate(typeof(ItemBaseView).FullName)),
                () => _configRepository.GetItemConfig().IsValid);

            _craftItems = new CommandViewModel(
                "Craft Items",
                new DelegateCommand(() => Navigate(typeof(ItemBaseView).FullName)),
                () => false);

            _viewResults = new CommandViewModel(
                "View Results",
                new DelegateCommand(() => Navigate(typeof(ItemBaseView).FullName)),
                () => false);

            Workspaces = new List <CommandViewModel>
            {
                _itemInput,
                _craftingProcess,
                _itemSelection,
                _craftItems,
                _viewResults
            };

            _configRepository.ConfigChanged += (x, y) => _itemInput.UpdateIsEnabled();
            _configRepository.ConfigChanged += (x, y) => _craftingProcess.UpdateIsEnabled();
        }
Beispiel #5
0
        public void TestItemCreation()
        {
            EquipmentType testType    = EquipmentType.Armour;
            string        testSubtype = "Body Armour";
            string        testBase    = "Vaal Regalia";

            EquipmentFetch fetch = container.Get <EquipmentFetch>();

            var bases = fetch.FetchBasesBySubtype(testSubtype);

            Assert.IsTrue(bases.Contains(testBase));
            var regaliaIndex = bases.IndexOf(testBase);

            var regaliaFactory = container.Get <EquipmentFactory>();

            regaliaFactory.Initialize(bases[regaliaIndex]);

            var regalia = regaliaFactory.CreateEquipment();

            Assert.IsNotNull(regalia);
        }