2020-10-16 06:27:40 +02:00
|
|
|
package ee364.hajj.transport;
|
|
|
|
|
2020-10-16 04:56:03 +02:00
|
|
|
import java.util.Date;
|
|
|
|
|
2020-10-09 21:58:00 +02:00
|
|
|
public class Sedan extends Vehicle implements Breakable {
|
|
|
|
|
|
|
|
private final int TIME_TO_FIX = 15; //in minutes
|
|
|
|
private boolean broken;
|
|
|
|
private boolean accident;
|
|
|
|
|
|
|
|
public Sedan(double vehicleSize, boolean govtCar){
|
2020-10-16 04:56:03 +02:00
|
|
|
super(vehicleSize, govtCar, 4);
|
2020-10-09 21:58:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isBroken(){ return broken; }
|
|
|
|
public boolean isInAccident(){ return accident; }
|
2020-10-16 04:56:03 +02:00
|
|
|
public void _break(Date time) { this.broken = true; } //TODO
|
|
|
|
public void collide(Breakable car, Date time) { this.accident = true; }//TODO //Maybe add time of accident and other breakable args
|
2020-10-09 21:58:00 +02:00
|
|
|
public int getTimeToFix(){ return TIME_TO_FIX; }
|
|
|
|
|
|
|
|
|
|
|
|
public void fixed() { this.broken = false; this.accident = false; }
|
|
|
|
|
|
|
|
}
|