-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
gmershad
committed
Dec 29, 2016
1 parent
27be94a
commit 4e14d68
Showing
13 changed files
with
106 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using FoodDeliveryApp.FoodDeliveryAppModel; | ||
using FoodDeliveryApp.RestaurantFoodMenu; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace FoodDeliveryApp.FoodDeliveryDriver | ||
{ | ||
/// <summary> | ||
/// This driver called - Iterator Pattern. | ||
/// </summary> | ||
public class MealMenuIteratorDriver | ||
{ | ||
public List<FoodMenuModel> PrintMealMenu(string restaurantId) | ||
{ | ||
Waitress waitress = new Waitress(restaurantId); | ||
var foodMenu = waitress.PrintFoodMenu(); | ||
return foodMenu; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace FoodDeliveryApp.RestaurantSearch | ||
{ | ||
|
||
/// <summary> | ||
/// This driver called module developed in Interpreter design pattern | ||
/// </summary> | ||
public class RestaurantSearchDriver | ||
{ | ||
public string RestaurantSearch() | ||
{ | ||
InterpreterContext context = new InterpreterContext("Some API"); | ||
RestaurantSearchClient client = new RestaurantSearchClient(context); | ||
Console.WriteLine("Search Restaurant(by Location)"); | ||
Console.WriteLine("Enter Location:"); | ||
var location = Console.ReadLine(); | ||
string searchSentence = string.Format("restaurant by location '{0}'", location); | ||
var result = client.Intercept(searchSentence); | ||
if (!result.Any()) Console.WriteLine("Sorry, No Restaurants available in this location."); | ||
|
||
string restaurantId = string.Empty; | ||
|
||
if (result.Any()) | ||
{ | ||
Console.WriteLine("List of Restaurants"); | ||
Console.WriteLine("*******************"); | ||
|
||
foreach (var item in result) | ||
{ | ||
Console.WriteLine(" "); | ||
Console.WriteLine("{0} {1}", item.RestaurantId, item.Name); | ||
Console.WriteLine("{0}", item.Address); | ||
int rating = item.Rating; | ||
Console.Write("Rating: "); | ||
while (rating > 0) | ||
{ | ||
Console.Write("*"); | ||
rating--; | ||
} | ||
|
||
Console.WriteLine(""); | ||
Console.WriteLine("_________________________________"); | ||
} | ||
|
||
Console.WriteLine(); | ||
Console.WriteLine("Please Select Restaurant by Id: "); | ||
restaurantId = Console.ReadLine(); | ||
} | ||
|
||
return restaurantId; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.