public void AddMushroomSoupOrder() { goalRecipes.Add(MushroomSoup); CurrentGoal = new FinishedMealGoal(goalRecipes); CurrentHeuristic = new IngredientBasedHeuristic(CurrentGoal); Debug.Log("Goal updated to: " + CurrentGoal + ", Heuristic: " + CurrentHeuristic); }
void Start() { IM = FindObjectOfType <ItemManager>(); PlayerRef = FindObjectOfType <Player>(); PlayerStartLocation = new GameObject("Player Start Location"); PlayerStartLocation.transform.position = PlayerRef.transform.position; CurrentGoal = new FinishedMealGoal(goalRecipes); CurrentHeuristic = new IngredientBasedHeuristic(CurrentGoal); Debug.Log("Start set the goal to be: " + CurrentGoal); StartCoroutine(LateStart()); }
public IngredientBasedHeuristic(FinishedMealGoal goal) { Goal = goal; NeededIngredients = Goal.GoalRecipes.SelectMany(r => r).ToList(); int NUM_INGREDIENT_TYPES = Enum.GetNames(typeof(IngredientType)).Length; CountOfEachIngredient = Enumerable.Repeat(0, NUM_INGREDIENT_TYPES).ToList(); foreach (IngredientType it in NeededIngredients) { ++CountOfEachIngredient[(int)it]; } }