Clean up TrafficPoliceCar and Changed CanBeGovtCar

Signed-off-by: HeshamTB <hishaminv@gmail.com>

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2020-11-10 00:01:37 +03:00
parent 713e902e05
commit 7c9fd44070
2 changed files with 4 additions and 14 deletions

View File

@ -1,3 +1,4 @@
public interface CanBeGovtCar {
void generateGovtID();
String getGovtID();
}

View File

@ -8,30 +8,19 @@ public class TrafficPoliceCar extends Vehicle implements CanBeGovtCar, CanFixAcc
* construct instance with random GovtID
* @param vehicleSize Length of vehicle in meters
*/
public TrafficPoliceCar(double vehicleSize){
public TrafficPoliceCar(double vehicleSize) {
super(vehicleSize);
getGovtID();
generateGovtID();
}
/**
* Construct instance with given GovtID
* @param vehicleSize Length of vehicle in meters
* @param govtID Provided Govt ID
*/
// public TrafficPoliceCar(double vehicleSize, int govtID) {
// super(vehicleSize);
// this.govtID = govtID;
// } //TODO ãÇ íÍÊÇÌ ÇääÇ ääÔÆ íæ Çí Ïí ÈãÇ Çäå ÇáÇäÔÇÁ Ú ÇáÓÊÇÊß
@Override
public void generateGovtID(){
numeberOfTPC++;
this.TPC_UID = String.format("TPC%03d", numeberOfTPC);
}
@Override
public String getGovtID() {
return this.TPC_UID;
}
}