AssemblyCSharp.PlayService.FindMatch C# (CSharp) Method

FindMatch() public method

public FindMatch ( List ingredients ) : RecipeMatch
ingredients List
return RecipeMatch
        public RecipeMatch FindMatch(List<Ingredient> ingredients)
        {
            var ingridientGroups = ingredients.Select (ingr => new WeightedValue(ingr.Definition.Type, ingr.Definition.Group, 1) ).ToList ();
            var evaluator = new RecipeEvaluator (ingridientGroups, IngredientsSupplementsProvider);
            var maxQuality = 0.0f;
            IRecipe bestRecipe = null;
            foreach (var recipe in GetCurrentRecipes ()) {
                var quality = evaluator.TestRecipe (recipe);
                PSDebug.LogInfo ("Match result {0} = {1}, used groups: {2}", recipe.Description, quality, ingridientGroups.ToDebugString ());

                if (quality >= maxQuality) {
                    maxQuality = quality;
                    bestRecipe = recipe;
                }
            }

            return new RecipeMatch {
                Component = _currentComponent,
                Recipe = bestRecipe,
                Quality = maxQuality
            };
        }