Remove Cap from Sedan and implement fix() from Breakable

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2020-10-21 05:45:16 +03:00
parent 49f7be0ceb
commit 1b8b05cbb5

View File

@ -5,11 +5,9 @@ public class Sedan extends Vehicle implements Breakable {
private final int TIME_TO_FIX = 15; //in minutes
private boolean broken;
private boolean accident;
private int capacity;
public Sedan(double vehicleSize){
super(vehicleSize);
capacity = 4; //Should make this attr. in vehicle.
}
public boolean isBroken(){ return broken; }
@ -26,9 +24,8 @@ public class Sedan extends Vehicle implements Breakable {
}
public int getTimeToFix(){ return TIME_TO_FIX; }
public int getCapacity() { return capacity; }
public void fixed() { this.broken = false; this.accident = false; }
public void fix() { this.broken = false; this.accident = false; }
}