예제 #1
0
 public void AddFoods(FoodCollection foodCollection)
 {
     foreach (var food in foodCollection)
     {
         Add(food);
     }
 }
예제 #2
0
    async void Start()
    {
        food = await LoadDataFromConfig();

        prefs = new PrefsManager();

        SpawnFood();
    }
예제 #3
0
    async void Start()
    {
        CreateGrid();
        SetWalls();

        foodCollection = await LoadDataFromConfig();

        SpawnFood();
    }
예제 #4
0
    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);
    }
예제 #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);
        }
예제 #6
0
 public IngredientAllergenCorrelationDictionary(FoodCollection foodCollection)
     : base()
 {
     AddFoods(foodCollection);
 }
예제 #7
0
 protected override void ResetState()
 {
     foodCollection = null;
 }
예제 #8
0
 protected override void LoadState()
 {
     foodCollection = new FoodCollection(ParsedFileLinesEnumerable(Food.Parse));
 }