Merge pull request #6 from AsaadDadoush/master

add enum
This commit is contained in:
HeshamTB 2020-11-11 21:42:09 +03:00 committed by GitHub
commit cc64faf912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 50 deletions

View File

@ -79,60 +79,60 @@ public class MakkahCity {
} }
private static void makeStreets(){ private static void makeStreets(){
stdStreet[StreetNames.KA_STREET] = new Street(22700,3); stdStreet[StreetNames.KA_STREET.ordinal()] = new Street(22700,3);
stdStreet[StreetNames.FOURTH_HIGHWAY] = new Street(24600,4); stdStreet[StreetNames.FOURTH_HIGHWAY.ordinal()] = new Street(24600,4);
stdStreet[StreetNames.KUDAY] = new Street(22000,3); stdStreet[StreetNames.KUDAY.ordinal()] = new Street(22000,3);
stdStreet[StreetNames.STREET1] = new Street(4000,2); stdStreet[StreetNames.STREET1.ordinal()] = new Street(4000,2);
stdStreet[StreetNames.STREET2] = new Street(7000,2); stdStreet[StreetNames.STREET2.ordinal()] = new Street(7000,2);
stdStreet[StreetNames.STREET3] = new Street(400,2); stdStreet[StreetNames.STREET3.ordinal()] = new Street(400,2);
stdStreet[StreetNames.STREET4] = new Street(8200,2); stdStreet[StreetNames.STREET4.ordinal()] = new Street(8200,2);
stdStreet[StreetNames.IBRAHIM_ALKHALIL] = new Street(100,2); //TODO: [7]Change numbers stdStreet[StreetNames.IBRAHIM_ALKHALIL.ordinal()] = new Street(100,2); //TODO: [7]Change numbers
} }
private static void makeRoutes() { private static void makeRoutes() {
stdRoutes[RouteName.mashierToAlHijra1] = new Route( stdRoutes[RouteName.mashierToAlHijra1.ordinal()] = new Route(
new Street[]{ new Street[]{
stdStreet[StreetNames.STREET1], stdStreet[StreetNames.STREET1.ordinal()],
stdStreet[StreetNames.STREET2], stdStreet[StreetNames.STREET2.ordinal()],
stdStreet[StreetNames.KUDAY]}, stdStreet[StreetNames.KUDAY.ordinal()]},
District.ALHIJRA, Mashier.ARAFAT); District.ALHIJRA, Mashier.ARAFAT);
stdRoutes[RouteName.mashierToAlHijra2] = new Route(new Street[]{ stdRoutes[RouteName.mashierToAlHijra2.ordinal()] = new Route(new Street[]{
stdStreet[StreetNames.STREET1], stdStreet[StreetNames.STREET1.ordinal()],
stdStreet[StreetNames.FOURTH_HIGHWAY], stdStreet[StreetNames.FOURTH_HIGHWAY.ordinal()],
stdStreet[StreetNames.STREET4] stdStreet[StreetNames.STREET4.ordinal()]
},District.ALHIJRA, Mashier.ARAFAT); },District.ALHIJRA, Mashier.ARAFAT);
stdRoutes[RouteName.mashierToAlMansoor1] = new Route( stdRoutes[RouteName.mashierToAlMansoor1.ordinal()] = new Route(
new Street[]{ new Street[]{
stdStreet[StreetNames.STREET1], stdStreet[StreetNames.STREET1.ordinal()],
stdStreet[StreetNames.STREET2], stdStreet[StreetNames.STREET2.ordinal()],
stdStreet[StreetNames.KA_STREET], stdStreet[StreetNames.KA_STREET.ordinal()],
stdStreet[StreetNames.STREET3] stdStreet[StreetNames.STREET3.ordinal()]
},District.ALMANSOOR, Mashier.ARAFAT); },District.ALMANSOOR, Mashier.ARAFAT);
stdRoutes[RouteName.mashierToAlMansoor2] = new Route( stdRoutes[RouteName.mashierToAlMansoor2.ordinal()] = new Route(
new Street[]{ new Street[]{
stdStreet[StreetNames.STREET1], stdStreet[StreetNames.STREET1.ordinal()],
stdStreet[StreetNames.STREET2], stdStreet[StreetNames.STREET2.ordinal()],
stdStreet[StreetNames.KUDAY], stdStreet[StreetNames.KUDAY.ordinal()],
stdStreet[StreetNames.IBRAHIM_ALKHALIL]//TODO: [8]is actually half of ibrahim khalil. stdStreet[StreetNames.IBRAHIM_ALKHALIL.ordinal()]//TODO: [8]is actually half of ibrahim khalil.
},District.ALMANSOOR, Mashier.ARAFAT); },District.ALMANSOOR, Mashier.ARAFAT);
//Optimal for Almansoor //Optimal for Almansoor
stdRoutes[RouteName.mashierToAlMansoor3] = new Route( stdRoutes[RouteName.mashierToAlMansoor3.ordinal()] = new Route(
new Street[]{ new Street[]{
stdStreet[StreetNames.STREET1], stdStreet[StreetNames.STREET1.ordinal()],
stdStreet[StreetNames.FOURTH_HIGHWAY], stdStreet[StreetNames.FOURTH_HIGHWAY.ordinal()],
stdStreet[StreetNames.IBRAHIM_ALKHALIL] stdStreet[StreetNames.IBRAHIM_ALKHALIL.ordinal()]
},District.ALMANSOOR, Mashier.ARAFAT); },District.ALMANSOOR, Mashier.ARAFAT);
stdRoutes[RouteName.mashierToAlAzizi1] = new Route( stdRoutes[RouteName.mashierToAlAzizi1.ordinal()] = new Route(
new Street[]{ new Street[]{
stdStreet[StreetNames.STREET1], stdStreet[StreetNames.STREET1.ordinal()],
stdStreet[StreetNames.STREET2], stdStreet[StreetNames.STREET2.ordinal()],
stdStreet[StreetNames.KA_STREET] stdStreet[StreetNames.KA_STREET.ordinal()]
},District.ALAZIZIYA, Mashier.ARAFAT); },District.ALAZIZIYA, Mashier.ARAFAT);
} }

View File

@ -1,10 +1,10 @@
public class RouteName { public enum RouteName {
public static final int mashierToAlMansoor1 = 0; mashierToAlMansoor1,
public static final int mashierToAlMansoor2 = 1; mashierToAlMansoor2 ,
public static final int mashierToAlMansoor3 = 2; mashierToAlMansoor3,
public static final int mashierToAlHijra1 = 3; mashierToAlHijra1,
public static final int mashierToAlHijra2 = 4; mashierToAlHijra2,
public static final int mashierToAlAzizi1 = 5; mashierToAlAzizi1
} }

View File

@ -1,15 +1,15 @@
/** /**
* Street names with their corresponding indices in MakkahCity. * Street names with their corresponding indices in MakkahCity.
*/ */
public class StreetNames { public enum StreetNames {
public static final int KA_STREET = 0; KA_STREET,
public static final int KUDAY = 1; KUDAY,
public static final int FOURTH_HIGHWAY = 2; FOURTH_HIGHWAY,
public static final int STREET1 = 3; STREET1,
public static final int STREET2 = 4; STREET2,
public static final int STREET3 = 5; STREET3,
public static final int STREET4 = 6; STREET4,
public static final int IBRAHIM_ALKHALIL = 7; IBRAHIM_ALKHALIL
} }