private Meal MakeKiddieMeal() { _mealBuilder = new KiddieMeal(); _chef.Cook(_mealBuilder); var kiddieMeal = _mealBuilder.ServeMeal(); return(kiddieMeal); }
public void Main() { // first task Potato potato = new Potato(); if (IsValid(potato)) { var IsReadyToCook = potato.ThereVegetablePeel && potato.IsCut; if (IsReadyToCook) { var chef = new Chef(); chef.Cook(potato); } } // second task bool shouldVisitCell = true; int horizontal = 5; int vertical = 5; int maxHorizontal = 10; int maxVertical = 10; bool hasCorrectHorizontalValue = horizontal >= maxHorizontal && horizontal <= maxHorizontal; bool hasCorrectVerticalValue = maxVertical >= vertical && maxVertical <= vertical; bool hasPremisionToVisitCell = hasCorrectHorizontalValue && hasCorrectVerticalValue && shouldVisitCell; if (hasPremisionToVisitCell) { VisitCell(); } }
public static void Main() { var chef = new Chef(); var bowl = chef.Cook(); System.Console.WriteLine(bowl); }
public void ProcessPotato(Potato potato) { if (potato != null && potato.IsPeeled && !potato.IsRotten) { chef.Cook(potato); } }
public static void Main() { Chef chef = new Chef(); Potato potato = new Potato(); potato.IsRotten = false; if (potato != null) { // Potato will be peeled during Cook process, so this check is not necessary if (!potato.IsRotten) { chef.Cook(potato); Console.WriteLine("Potato is cooked!"); } else { throw new ArgumentOutOfRangeException("Cannot cook rotten potato!"); } } else { throw new ArgumentNullException("There is no potato!"); } }
public static void Main(string[] args) { Chef chef = new Chef(); IIngredient[] list = new IIngredient[] { new Carrot(), new Potato() }; chef.Cook(list); }
public static void Main() { Chef chefNiko = new Chef(); chefNiko.Cook(); BoundsValidator someTestMatrix = new BoundsValidator(); someTestMatrix.GoToCell(1, 1, false); }
public static void Main() { var chef = new Chef("Salty Macannon"); chef.Introduce(); var carrot = chef.GetCarrot(); var potato = chef.GetPotato(); var bowl = chef.GetBowl(); chef.Cook(potato, carrot, bowl); }
public static void Main() { Potato potato = new Potato(); if (potato != null) { if (!(potato.HasNotBeenPeeled || potato.IsRotten)) { Chef masterChef = new Chef(); masterChef.Cook(potato); } } }
public static Bowl ProcessVegetable(Vegetable vegetable, Chef chef) { bool isCookable = IsCookable(vegetable); if (isCookable) { return(chef.Cook(vegetable)); } else { throw new ArgumentException("The vegetable must be peeled and not rotten in order to be cooked."); } }
public static void Main() { Chef chef = new Chef(); Potato potato = new Potato(); if (potato == null) { throw new ArgumentNullException("Potato should be created."); } else if (potato.IsPeeled && potato.IsRotten) { chef.Cook(potato); } }
public static void CookVegitable(Vegetable vegitable, Chef chef) { Potato potato = new Potato(); bool isCookable = IsCookable(potato); if (isCookable) { chef.Cook(potato); } else { throw new ArgumentException("The vegitable should be peeled and shouldn't be rotten!"); } }
public static void PrepareMeal() { var potato = GetPotato(); var chef = new Chef(); if (potato == null) { throw new ArgumentNullException(); } if ((!potato.IsRotten) && (potato.IsPeeled)) { var bowl = chef.Cook(); } else { throw new NotImplementedException(); } }
public static void PrepareMeal() { var potato = GetPotato(); var chef = new Chef(); if (potato == null) { throw new ArgumentNullException(); } if((!potato.IsRotten)&&(potato.IsPeeled)) { var bowl = chef.Cook(); } else { throw new NotImplementedException(); } }
private static void Main() { Chef gosho = new Chef("Georgi", "Oklahoma"); Potato potato = new Potato(0.5, 0.3m); if (potato == null) { throw new ArgumentNullException("Vegetable item cannot be null"); } if (!potato.IsPeeled && potato.IsRotten) { throw new ArgumentException( "Vegetable must be not rotten and peeled before cooking"); } gosho.Cook(potato); }
internal static void CookMeal(Chef chef, Potato potato, Carrot carrot) { if (potato != null && chef != null) { if (potato.IsPeeled && !potato.IsRotten) { chef.Cook(potato, carrot); } else { Console.WriteLine(chef.Name + " ANGRY!!! " + chef.Name + " SMASHHH!!!"); Console.WriteLine("Don't you be givin me no rotten potatoes!"); Console.ReadLine(); } } else { Console.WriteLine("Where my potato AT!"); } }
public static void Main(string[] args) { Potato potato = new Potato(); Chef chef = new Chef(); // Refactor the following if statements: //Potato potato; ////... //if (potato != null) // if (!potato.HasNotBeenPeeled && !potato.IsRotten) // Cook(potato); if (potato != null) { if (potato.HasBeenPeeled && potato.IsFresh) { chef.Cook(potato); } } }
public static void Main() { Potato potato = new Potato(); Chef chef = new Chef(); if (potato != null) { if (potato.IsGood && potato.HasBeenPeeled) { chef.Cook(potato); } else { // take new potato and peel it... } } else { // take some potato... } }
public static void Main() { /* * Potato potato; * if (potato != null) * if (!potato.HasNotBeenPeeled && !potato.IsRotten) * Cook(potato); */ Potato potato = new Potato(); Chef chef = new Chef(); potato.IsPeeled = true; potato.IsRotten = false; if (potato != null) { if (potato.IsPeeled && !potato.IsRotten) { chef.Cook(potato); } } /* * if (x >= MIN_X && (x =< MAX_X && ((MAX_Y >= y && MIN_Y <= y) && !shouldNotVisitCell))) * { * VisitCell(); * } */ int x = 4; int y = 5; bool shouldVisitCell = true; if (InRange(x, y) && shouldVisitCell) { VisitCell(); } }
// Minigame endings, except plating. #region EndMinigames public void EndEstufa(bool exito) { Debug.Log("Ganó juego de estufa: " + exito); miniJuegoEstufa.enabled = false; canvasEstufa.SetActive(false); GUI = false; exitoEstufa = true; // source.PlayOneShot(victory); if (exito) { cheffy.Cook(); } }
static void Main(string[] args) { Chef chef = new Chef(); chef.Cook(); }
static void Main() { Chef chef = new Chef(); chef.Cook(); }
public static void Main() { var chef = new Chef(); chef.Cook(); }
public static void Main(string[] args) { Chef chef = new Chef(); chef.Cook(); }
public static void Main(string[] args) { // Task 2. Refactor the following if statements Potato potato = new Potato(); Chef chefManchev = new Chef(); // ... if (potato != null) { if (!potato.HasNotBeenPeeled && !potato.IsRotten) { chefManchev.Cook(potato); } } // Task 3. Refactor the following loop int x = GetX(); int xMax = 200; int xMin = 100; int y = GetY(); int yMax = 2000; int yMin = 1000; bool isValidX = (x >= xMin) && (x <= xMax); bool isValidY = (y >= yMin) && (y <= yMax); bool shouldVisitCell = true; if (isValidX && isValidY && shouldVisitCell) { VisitCell(); } int[] arrayHoldingTheValues = new int[100]; // Fillout the array with test values for (int i = 0; i < 100; i++) { arrayHoldingTheValues[i] = i + 1; } int expectedValue = 11; bool isFoundTheValue = false; // Traversing array and searching for the expextedValue for (int i = 0; i < 100; i++) { Console.WriteLine(arrayHoldingTheValues[i]); if (i % 10 == 0) { if (arrayHoldingTheValues[i] == expectedValue) { isFoundTheValue = true; break; } } } // More code here if (isFoundTheValue) { Console.WriteLine("Value Found"); } }
private static void Main() { Chef hristo = new Chef("Ico", "VelikoSelo"); hristo.Cook(); }
public static void Main() { var chef = new Chef(); var result = chef.Cook(); result.Serve(); }
public static void Main() { Chef master = new Chef(); master.Cook(); }