Exemple #1
0
 public void AddFoods(FoodCollection foodCollection)
 {
     foreach (var food in foodCollection)
     {
         Add(food);
     }
 }
Exemple #2
0
    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);
    }
Exemple #5
0
        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);
        }
Exemple #6
0
 public IngredientAllergenCorrelationDictionary(FoodCollection foodCollection)
     : base()
 {
     AddFoods(foodCollection);
 }
Exemple #7
0
 protected override void ResetState()
 {
     foodCollection = null;
 }
Exemple #8
0
 protected override void LoadState()
 {
     foodCollection = new FoodCollection(ParsedFileLinesEnumerable(Food.Parse));
 }