I’m creating a restaurant game where customers come in and request a random meal and drink.
I’ve set it up so far to generate a customer (male/female) and they’ll request a random meal and drink from a string.
Now, I want every meal and drink to have specific ingredients that the player needs to click, but as a C# noob I don’t know how…
Thus, I would like to request some help from the community!
Any and all help is appreciated
using System.Collections.Generic;
public class Food {
string[] ingredients = new string[0];
public Food() {}
public Food(string[] i) {
ingredients = i;
}
}
public Food frenchFries = new Food(new string[] {"Potato", "Salt"});
public Dictionary<string, Food> cookbook = new Dictionary<string, Food>();
void Start() {
cookbook.Add("TomatoSoup", new Food(new string[] {"Tomato", "Water", "Cream"}));
cookbook.Add("FrenchFries", frenchFries);
if(cookbook.ContainsKey("FrenchFries")) {
Debug.Log(French Fries can be ordered!");
Debug.Log(To make French Fries, you need:");
foreach(string ingredient in cookbook["FrenchFries"].ingredients) {
Debug.Log("ingredient");
}
}
}