Menu functions:
- View Vehicles - View Routes
This commit is contained in:
parent
b85a4040f2
commit
4346b9348d
@ -4,9 +4,9 @@ public class InputListener implements Runnable {
|
|||||||
|
|
||||||
private volatile String input = "";
|
private volatile String input = "";
|
||||||
private volatile boolean hasNew;
|
private volatile boolean hasNew;
|
||||||
|
private volatile boolean pause;
|
||||||
private final Scanner in;
|
private final Scanner in;
|
||||||
private boolean stop;
|
private boolean stop;
|
||||||
private boolean pause;
|
|
||||||
|
|
||||||
public InputListener() {
|
public InputListener() {
|
||||||
in = new Scanner(System.in);
|
in = new Scanner(System.in);
|
||||||
|
@ -152,7 +152,7 @@ public class MakkahCity {
|
|||||||
lastDayTimeMan.step(Calendar.MINUTE, 1);
|
lastDayTimeMan.step(Calendar.MINUTE, 1);
|
||||||
//for (int i = 0; i < 46; i++) System.out.print("\b");
|
//for (int i = 0; i < 46; i++) System.out.print("\b");
|
||||||
}
|
}
|
||||||
inputListener.stop();
|
t.interrupt();
|
||||||
//TODO: print final report
|
//TODO: print final report
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,6 +182,23 @@ public class MakkahCity {
|
|||||||
"[3] View Campaigns\n" +
|
"[3] View Campaigns\n" +
|
||||||
"[4] View Routes");
|
"[4] View Routes");
|
||||||
String chose = in.next();
|
String chose = in.next();
|
||||||
|
if (chose.equals("1")){
|
||||||
|
System.out.printf("choose from 0 to %d", listOfVehicles.size()-1);
|
||||||
|
String c = in.next();
|
||||||
|
Vehicle v = listOfVehicles.get(Integer.parseInt(c));
|
||||||
|
//TODO: override toString() in vehicle then Bus. This will throw cast ex.
|
||||||
|
System.out.printf("%s\n Campaign: %s Street: %s Location: %.1f\n" +
|
||||||
|
"Arrived: %s Starting time: %s Arrive Time: %s\n",
|
||||||
|
v.toString(), ((Bus)v).getCampaign().getUID(),v.getCurrentStreet().getName().name(),
|
||||||
|
v.getCurrentLocation(),v.isArrivedToDest(),v.getTimeStartedMoving(),v.getTimeOfArrival());
|
||||||
|
startMenu();
|
||||||
|
}
|
||||||
|
if (chose.equals("4")){
|
||||||
|
for (int i = 0; i < stdRoutes.length; i++){
|
||||||
|
System.out.printf("[%d] %s\n", i, stdRoutes[i]);
|
||||||
|
}
|
||||||
|
String c = in.next();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void clearDoneCivilVehicles() {
|
private static void clearDoneCivilVehicles() {
|
||||||
@ -350,8 +367,6 @@ public class MakkahCity {
|
|||||||
},District.ALAZIZIYA, Mashier.MINA);
|
},District.ALAZIZIYA, Mashier.MINA);
|
||||||
//******Mina Leave end
|
//******Mina Leave end
|
||||||
|
|
||||||
// for (Route r : stdRoutes)
|
|
||||||
// System.out.println(r.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void fillBusesToList() {
|
private static void fillBusesToList() {
|
||||||
|
Loading…
Reference in New Issue
Block a user