Skip to content

Commit

Permalink
change of order method
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis-Feng committed Oct 14, 2020
1 parent a64a38e commit 288e1bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/main/java/Customer.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ public Order order(Canteen canteen,Stall stall,List<Dish> 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;
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/deliveryOrder.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Dish> dishes, Customer customer, boolean isDeliveryOrder,
String address, String phoneNumber) {
String address, int phoneNumber) {
super(canteen, stall, dishes, customer);
this.isDeliveryOrder = isDeliveryOrder;
this.address = address;
Expand All @@ -33,7 +33,7 @@ public String getAddress() {
return this.address;
}

public String getPhoneNumber() {
public int getPhoneNumber() {
return this.phoneNumber;
}

Expand Down

0 comments on commit 288e1bb

Please sign in to comment.