public void AddFoods(FoodCollection foodCollection) { foreach (var food in foodCollection) { Add(food); } }
async void Start() { food = await LoadDataFromConfig(); prefs = new PrefsManager(); SpawnFood(); }
async void Start() { CreateGrid(); SetWalls(); foodCollection = await LoadDataFromConfig(); SpawnFood(); }
async Task <FoodCollection> LoadDataFromConfig() { FoodCollection food = null; string path = Path.Combine(Application.dataPath, fileName); if (File.Exists(path)) { string jsonData = File.ReadAllText(path); food = JsonUtility.FromJson <FoodCollection>(jsonData); } return(food); }
public void CompositeImplementation() { var shop = new FoodCollection("KFC"); var childCombo = new FoodCollection("Children Combo Box"); childCombo.Add(new SimpleFood("Nugget")); childCombo.Add(new SimpleFood("Chicken")); var adultCombo = new FoodCollection("Adult Combo Box"); adultCombo.Add(new SimpleFood("Burger")); adultCombo.Add(new SimpleFood("Chicken")); shop.Add(childCombo); shop.Add(adultCombo); var info = shop.ShowInfo(); Assert.That(info.Length > 0); }
public IngredientAllergenCorrelationDictionary(FoodCollection foodCollection) : base() { AddFoods(foodCollection); }
protected override void ResetState() { foodCollection = null; }
protected override void LoadState() { foodCollection = new FoodCollection(ParsedFileLinesEnumerable(Food.Parse)); }