diff --git a/src/MakkahCity.java b/src/MakkahCity.java index 1cc1d28..11831f7 100644 --- a/src/MakkahCity.java +++ b/src/MakkahCity.java @@ -600,6 +600,7 @@ public class MakkahCity { report.append(String.format("%-9s|",campPerDistrict[i].get(0).getHotelDistrict().name())); report.append(String.format(" %-10d|",campPerDistrict[i].size())); + report.append(String.format(" %-7d|", busesInDistrict(District.values()[i]))); //Calc values per dist here. report.append("\n"); @@ -625,6 +626,14 @@ public class MakkahCity { return String.format("%02d:%02d", hours, minutes); } + private static int busesInDistrict(District district){ + int buses = 0; + for (Campaign campaign : campPerDistrict[district.ordinal()]){ + buses += campaign.getNumberOfBusses(); + } + return buses; + } + public static final String ANSI_RESET = "\u001B[0m"; public static final String ANSI_BLACK = "\u001B[30m"; public static final String ANSI_RED = "\u001B[31m";