generated from ucudal/PII_Desafio_Menu_1_Start
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.cs
More file actions
35 lines (31 loc) · 751 Bytes
/
Menu.cs
File metadata and controls
35 lines (31 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Collections.Generic;
namespace Ucu.Poo.Restaurant
{
/// <summary>
/// Representa el conjunto de platillos <see cref="Dish"/> disponibles en el
/// restaurante.
/// </summary>
public class Menu
{
private List<Dish> dishes = new List<Dish>();
public void AddDish(Dish dish)
{
dishes.Add(dish);
}
public void RemoveDish(Dish dish)
{
dishes.Remove(dish);
}
public Dish GetDishByName(string name)
{
foreach (Dish dish in dishes)
{
if (dish.Name == name)
{
return dish;
}
}
return null;
}
}
}