From 288e1bb1836eb4b258a4c83e920ae7cdc33fad82 Mon Sep 17 00:00:00 2001 From: Feng Qingyu Date: Wed, 14 Oct 2020 14:48:45 +0800 Subject: [PATCH] change of order method --- src/main/java/Customer.java | 6 +++--- src/main/java/deliveryOrder.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/Customer.java b/src/main/java/Customer.java index 97959fb08d..1b7688bc8d 100644 --- a/src/main/java/Customer.java +++ b/src/main/java/Customer.java @@ -62,13 +62,13 @@ public Order order(Canteen canteen,Stall stall,List dish, String typeOfOrd Scanner s = new Scanner(System.in); int phoneNum = s.nextInt(); String address = s.nextLine(); - return new deliveryOrder(canteen,stall,dish,true,address,phoneNum); + return new deliveryOrder(canteen,stall,dish,this,true,address,phoneNum); } if(typeOfOrder.compareTo("dine in")==0){ - return new dineInOrder(canteen,stall,dish,true); + return new dineInOrder(canteen,stall,dish,this,true); } if(typeOfOrder.compareTo("take away")==0){ - return new takeAwayOrder(canteen,stall,dish,true); + return new takeAwayOrder(canteen,stall,dish,this,true); } return null; } diff --git a/src/main/java/deliveryOrder.java b/src/main/java/deliveryOrder.java index 78942e6b11..7a3eea93dd 100644 --- a/src/main/java/deliveryOrder.java +++ b/src/main/java/deliveryOrder.java @@ -7,10 +7,10 @@ public class deliveryOrder extends Order { private boolean isDeliveryOrder; private String address; - private String phoneNumber; + private int phoneNumber; deliveryOrder(Canteen canteen, Stall stall, List dishes, Customer customer, boolean isDeliveryOrder, - String address, String phoneNumber) { + String address, int phoneNumber) { super(canteen, stall, dishes, customer); this.isDeliveryOrder = isDeliveryOrder; this.address = address; @@ -33,7 +33,7 @@ public String getAddress() { return this.address; } - public String getPhoneNumber() { + public int getPhoneNumber() { return this.phoneNumber; }