-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExpressOrderProcessor.cs
More file actions
40 lines (33 loc) · 1.04 KB
/
ExpressOrderProcessor.cs
File metadata and controls
40 lines (33 loc) · 1.04 KB
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
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SDP_Project
{
class ExpressOrderProcessor : OrderProcessor
{
public double ExpressCharge { get; set; } = 15.0;
public ExpressOrderProcessor(Order order, Restaurant restaurant) : base(order, restaurant) { }
public override double CalculateDeliveryPrice()
{
return restaurant.RestaurantDeliveryPrice + ExpressCharge;
}
public override List<OrderItem> SelectItems()
{
return order.OrderItems;
}
public override bool ValidateOrder()
{
return order.OrderItems.Count > 0;
}
public override void ProcessOrder()
{
Console.WriteLine($"Processing express order for {order.DeliveryAddress}.");
}
public override void DeliverOrder()
{
Console.WriteLine($"Delivering order to {order.DeliveryAddress} with express delivery.");
}
}
}