Ejemplo n.º 1
0
        private void AddRecipeItems(List <PlayerHeldItem> items, ItemSearchRequest query)
        {
            var recipes = _dbItemDao.SearchForRecipeItems(query);

            var itemsWithRecipe = items.FindAll(item => recipes.Any(recipe => recipe.BaseRecord == item.BaseRecord));

            foreach (var item in items)
            {
                if (itemsWithRecipe.Any(recipe => recipe.BaseRecord == item.BaseRecord))
                {
                    item.HasRecipe = true;
                }
            }

            // TODO: This should use .Except(), find out why its not working with .Except()
            var remainingRecipes = recipes.Where(recipe => itemsWithRecipe.All(item => item.BaseRecord != recipe.BaseRecord));

            items.AddRange(remainingRecipes);
        }
Ejemplo n.º 2
0
 public IList <RecipeItem> SearchForRecipeItems(ItemSearchRequest query)
 {
     return(ThreadExecuter.Execute(
                () => _repo.SearchForRecipeItems(query)
                ));
 }
Ejemplo n.º 3
0
 public IList <RecipeItem> SearchForRecipeItems(Search query)
 {
     return(ThreadExecuter.Execute(
                () => repo.SearchForRecipeItems(query)
                ));
 }