Beispiel #1
0
        public void OrderFood(FoodSystem context, int id)
        {
            var food = _foodDataAccess.GetFood(id);

            Console.WriteLine($"You ordered: {food.Name}");
            context.SetNextState(new FoodOrderedState(food));
        }
Beispiel #2
0
 public void ListOrderedFood(FoodSystem context)
 {
     foreach (var food in _orderedFood)
     {
         Console.WriteLine($"Food you ordered: {food.Name}");
     }
 }
Beispiel #3
0
        public void OrderFood(FoodSystem context, int id)
        {
            var food = _foodDataAccess.GetFood(id);

            Console.WriteLine($"You ordered: {food.Name}");
            _orderedFood.Add(food);
        }
Beispiel #4
0
 public void ShowFood(FoodSystem context)
 {
     Console.WriteLine("Currently we have in stock : ");
     foreach (var food in _foodDataAccess.GetAllFoods())
     {
         Console.WriteLine($"{food.Name} / for: {food.Price}");
     }
 }
Beispiel #5
0
 public void Login(FoodSystem context, string user, string pass)
 {
     Console.WriteLine($"Logged in as {user}");
     context.SetNextState(new LoggedInState());
 }
Beispiel #6
0
 public void ListOrderedFood(FoodSystem context)
 {
     Console.WriteLine("You are not logged in yet !");
 }
Beispiel #7
0
 public void OrderFood(FoodSystem context, int id)
 {
     Console.WriteLine("You are not logged in yet !");
 }
Beispiel #8
0
 public void ShowFood(FoodSystem context)
 {
     Console.WriteLine("You are not logged in yet !");
 }
Beispiel #9
0
 public void ListOrderedFood(FoodSystem context)
 {
     Console.WriteLine("No food ordered yet !!!");
 }
Beispiel #10
0
 public void Logout(FoodSystem context)
 {
     Console.WriteLine("You logged out!");
     context.SetNextState(new GuestUserState());
 }
Beispiel #11
0
 public void Login(FoodSystem context, string user, string pass)
 {
     Console.WriteLine("You are already logged in");
 }