improved Vehicle output
This commit is contained in:
parent
0e4f871770
commit
5f3488c4d0
@ -33,8 +33,8 @@ public class Bus extends CivilVehicle {
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder s = new StringBuilder();
|
||||
s.append(String.format("\nID: %s, Campaign ID: %s\n",this.getUID() , getCampaign().getUID()));
|
||||
s.append(super.toString());
|
||||
s.append(String.format("ID: %s, Campaign ID: %s\n",this.getUID() , getCampaign().getUID()));
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
|
@ -255,9 +255,9 @@ public abstract class Vehicle {
|
||||
Street st = this.currentStreet;
|
||||
String streetString = "null";
|
||||
if (st != null) streetString = st.getName().name();
|
||||
return String.format("%s\nRoute: %s\nStreet: %s, Location: %.1f, Distance covered: %.1f, Progress: %s\n" +
|
||||
"Arrived: %s Starting time: %s Arrive Time: %s, Trip time: %s\n",
|
||||
super.toString(), this.route, streetString,
|
||||
return String.format("\nRoute: %s\nStreet: %s, Location: %.1f, Distance covered: %.1f, Progress: %s\n" +
|
||||
"Arrived: %s\nStarting time: %s\nArrive Time: %s\nTrip time: %s\n",
|
||||
this.route, streetString,
|
||||
this.getCurrentLocation(), this.totalDistanceTraveled, getProgress(), this.isArrivedToDest(),
|
||||
this.getTimeStartedMoving(), this.getTimeOfArrival(), getTripTime());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user