Ejemplo n.º 1
0
        public override void Load()
        {
            Recipes.Clear();
            var recipes = recipesRepository.GetAll();

            Recipes.AddRange(recipes);
        }
Ejemplo n.º 2
0
            public void Step()
            {
                int newNumber = Recipes[_indices[0]] + Recipes[_indices[1]];

                Recipes.AddRange(_digits[newNumber]);

                _indices[0] = (_indices[0] + Recipes[_indices[0]] + 1) % Recipes.Count;
                _indices[1] = (_indices[1] + Recipes[_indices[1]] + 1) % Recipes.Count;

                for (; ; _inputDigitsNextCheckPosition++)
                {
                    if (InputDigitsFoundAt >= 0)
                    {
                        break;
                    }

                    if (_inputDigitsNextCheckPosition >= Recipes.Count)
                    {
                        break;
                    }

                    if (Recipes[_inputDigitsNextCheckPosition] == _inputDigits[_inputDigitsNextCheckIndex])
                    {
                        if (++_inputDigitsNextCheckIndex == _inputDigits.Length)
                        {
                            InputDigitsFoundAt = _inputDigitsNextCheckPosition - _inputDigits.Length + 1;
                        }
                    }
                    else
                    {
                        _inputDigitsNextCheckIndex = 0;
                    }
                }
            }
Ejemplo n.º 3
0
            public void CreateNewRecipe()
            {
                var newRecipes = CalculateNewRecipes();

                Recipes.AddRange(newRecipes);
                Elf1Index = (Elf1Index + Recipes[Elf1Index] + 1) % Recipes.Count;
                Elf2Index = (Elf2Index + Recipes[Elf2Index] + 1) % Recipes.Count;
            }
Ejemplo n.º 4
0
 /// <summary>Loads the default game mill products.</summary>
 private void LoadDefaultRecipes()
 {
     Recipes.AddRange(new List <Recipe>()
     {
         new Recipe(271, new Output(423, 1)), // unmilled rice/rice
         new Recipe(262, new Output(246, 1)), // wheat/flour
         new Recipe(284, new Output(245, 3))  // beet/sugar
     });
 }
Ejemplo n.º 5
0
        // Private methods
        private async Task LoadRecipes()
        {
            var result = await _recipeService.GetRecipesAsync(_nextPage);

            if (string.IsNullOrEmpty(_nextPage))
            {
                Recipes.Clear();
            }
            Recipes.AddRange(result.Results);

            _nextPage = result.Next;
        }
Ejemplo n.º 6
0
        public async void SearchRecipe()
        {
            Recipes.Clear();
            IEnumerable <Recipe> data;

            if (_currentRecipeType == RecipeType.Cooking)
            {
                data = BdoDataService.GetCookingRecipeByName(SearchStr);
                await Task.CompletedTask;
            }
            else
            {
                data = BdoDataService.GetAlchemyRecipeByName(SearchStr);
                await Task.CompletedTask;
            }

            Recipes.AddRange(data);
            NotifyOfPropertyChange(() => Recipes);
        }
Ejemplo n.º 7
0
        public async Task LoadDataAsync(RecipeType recipeType)
        {
            _currentRecipeType = recipeType;
            Recipes.Clear();
            IEnumerable <Recipe> data;

            if (recipeType == RecipeType.Cooking)
            {
                data = BdoDataService.AllCookingRecipes();
                await Task.CompletedTask;
            }
            else
            {
                data = BdoDataService.AllAlchemyRecipes();
                await Task.CompletedTask;
            }

            Recipes.AddRange(data);
            NotifyOfPropertyChange(() => Recipes);
        }
Ejemplo n.º 8
0
 public TradeSet(string name, params ItemRecipe[] recipes)
 {
     Name = name;
     Recipes.AddRange(recipes);
 }