-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStandardOrderProcessor.cs
More file actions
40 lines (33 loc) · 1.04 KB
/
StandardOrderProcessor.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 StandardOrderProcessor : OrderProcessor
{
public double DeliveryFee { get; set; } = 5.0;
public StandardOrderProcessor(Order order, Restaurant restaurant) : base(order, restaurant) { }
public override double CalculateDeliveryPrice()
{
return restaurant.RestaurantDeliveryPrice + DeliveryFee;
}
public override List<OrderItem> SelectItems()
{
return order.OrderItems;
}
public override bool ValidateOrder()
{
return order.OrderItems.Count > 0;
}
public override void ProcessOrder()
{
Console.WriteLine($"Processing standard order for {order.DeliveryAddress}.");
}
public override void DeliverOrder()
{
Console.WriteLine($"Delivering order to {order.DeliveryAddress} with standard delivery.");
}
}
}