コード例 #1
0
ファイル: Chef.cs プロジェクト: BogdanDimov/HQC-1-HW
    public void Cook()
    {
        Vegetable potato = GetVegetable(VegetableType.Potato);

        Peel(potato);
        Cut(potato);

        Vegetable carrot = GetVegetable(VegetableType.Carrot);

        Peel(carrot);
        Cut(carrot);

        Bowl bowl = GetBowl();

        bowl.Add(carrot);
        bowl.Add(potato);

        var sb = new StringBuilder();

        sb.Append("Bowl with ");
        foreach (var vegetable in bowl.Vegetables)
        {
            sb.Append($"{vegetable.Type.ToString().ToLower()} + ");
        }

        sb.Remove(sb.Length - 3, 3);
        sb.Append(" is now prepared!");
        Console.WriteLine(sb.ToString());
    }
コード例 #2
0
        public void Cook()
        {
            Potato potato = GetPotato();
            Carrot carrot = GetCarrot();
            Bowl   bowl   = GetBowl();

            Peel(potato);
            Peel(carrot);
            Cut(potato);
            Cut(carrot);
            bowl.Add(carrot);
            bowl.Add(potato);
        }
コード例 #3
0
        public void Main()
        {
            Potato potato = new Potato();
            Carrot carrot = new Carrot();
            Peel(potato);
            Peel(carrot);
            Cut(potato);
            Cut(carrot);

            Bowl bowl = new Bowl();
            bowl.Add(carrot);
            bowl.Add(potato);
        }
コード例 #4
0
ファイル: Chef.cs プロジェクト: RashaHussein/Telerik-Academy
        public void Cook()
        {
            Potato potato = this.GetPotato();
            Carrot carrot = this.GetCarrot();

            this.Peel(potato);
            this.Peel(carrot);
            this.Cut(potato);
            this.Cut(carrot);
            Bowl bowl = this.GetBowl();

            bowl.Add(carrot);
            bowl.Add(potato);
        }
コード例 #5
0
        public void Cook(Vegetable vegetable)
        {
            Potato potato = new Potato();
            potato.Peel();
            potato.Cut();

            Carrot carrot = new Carrot();
            carrot.Peel();
            carrot.Cut();

            Bowl bowl = new Bowl();
            bowl.Add(potato);
            bowl.Add(carrot);
        }
コード例 #6
0
    public void Cook()
    {
        Bowl bowl = GetBowl();

        Potato potato = GetPotato();

        ProcessVegetable(potato);
        bowl.Add(potato);

        Carrot carrot = GetCarrot();

        ProcessVegetable(carrot);
        bowl.Add(carrot);
    }
コード例 #7
0
        public void Cook()
        {
            Potato potato       = this.GetPotato();
            Potato peeledPotato = this.Peel(potato);
            Potato cuttedPotato = this.Cut(peeledPotato);
            Bowl   bowl         = this.GetBowl();

            bowl.Add(cuttedPotato);

            Carrot carrot       = this.GetCarrot();
            Carrot peeledCarrot = this.Peel(carrot);
            Carrot cuttedCarrot = this.Cut(peeledCarrot);

            bowl.Add(cuttedCarrot);
        }
コード例 #8
0
        public static void Main()
        {
            Bowl bowl = GetBowl();

            Carrot carrot = GetCarrot();

            Peel(carrot);
            Cut(carrot);
            bowl.Add(carrot);

            Potato potato = GetPotato();

            Peel(potato);
            Cut(potato);
            bowl.Add(potato);
        }
コード例 #9
0
ファイル: Chef.cs プロジェクト: steffdimitrov/TelerikAcademy
        public void Cook()
        {
            Potato potato = this.GetPotato();
            Carrot carrot = this.GetCarrot();

            Vegetable peeledPotato = Vegetable.Peel(potato);
            Vegetable peeledCarrot = Vegetable.Peel(carrot);

            Vegetable cutPotato = this.Cut(potato);
            Vegetable cutCarrot = this.Cut(carrot);

            Bowl bowl = this.GetBowl();

            bowl.Add(cutPotato);
            bowl.Add(cutCarrot);
        }
コード例 #10
0
 public void Cook(Vegetable vegetable)
 {
     Peel(vegetable);
     Cut(vegetable);
     bowl = GetBowl();
     bowl.Add(vegetable);
 }
コード例 #11
0
        public Bowl Cook(Vegetable vegetable)
        {
            Bowl bowl = this.GetBowl();

            bowl.Add(vegetable);

            return(bowl);
        }
コード例 #12
0
        public void Cook()
        {
            Bowl vegetablesBowl = GetBowl();

            Potato averagePotato = GetPotato();

            Peel(averagePotato);
            Cut(averagePotato);

            vegetablesBowl.Add(averagePotato);

            Carrot smallCarrot = GetCarrot();

            Peel(smallCarrot);
            Cut(smallCarrot);

            vegetablesBowl.Add(smallCarrot);
        }
コード例 #13
0
    public void Cook()
    {
        Bowl bowl = GetBowl();

        // processing carrot
        Carrot carrot       = GetCarrot();
        var    peeledCarrot = Peel(carrot);
        var    cuttedCarrot = Cut(peeledCarrot);

        bowl.Add(cuttedCarrot);

        // processing potato
        Potato potato       = GetPotato();
        var    peeledPotato = Peel(potato);
        var    cuttedPotato = Cut(peeledPotato);

        bowl.Add(cuttedPotato);
    }
コード例 #14
0
        public Bowl Cook()
        {
            Potatoe potato = this.GetPotato();

            this.Peel(potato);
            this.Cut(potato);

            Carrot carrot = this.GetCarrot();

            this.Peel(carrot);
            this.Cut(carrot);

            Bowl bowl = this.GetBowl();

            bowl.Add(potato);
            bowl.Add(carrot);

            return(bowl);
        }
コード例 #15
0
ファイル: Chef.cs プロジェクト: markovood/HQC-Part1
        public void Cook()
        {
            uint potatoWeight   = 200;
            uint potatoCalories = 77;
            uint carrotWeight   = 50;
            uint carrotCalories = 41;
            uint bowlVolume     = 2000;
            uint bowlSize       = 22;

            Potato potato = this.GetPotato(potatoWeight, potatoCalories);
            Carrot carrot = this.GetCarrot(carrotWeight, carrotCalories);
            Bowl   bowl   = this.GetBowl(bowlVolume, bowlSize);

            this.Peel(potato);
            this.Peel(carrot);

            this.Cut(potato);
            this.Cut(carrot);

            bowl.Add(carrot);
            bowl.Add(potato);
        }
コード例 #16
0
    public void Cook()
    {
        Potato potato = GetPotato();
        Carrot carrot = GetCarrot();
        Bowl   bowl   = GetBowl();

        int potatosNeeded = 2;

        for (int i = 0; i < potatosNeeded; i++)
        {
            Peel(potato);
            //Cut(potato);
            bowl.Add(potato);
        }

        int carrotsNeeded = 2;

        for (int i = 0; i < carrotsNeeded; i++)
        {
            Peel(carrot);
            //Cut(carrot);
            bowl.Add(carrot);
        }
    }