/*
 * @topic T02387 Assignment a8 -- Airline Flight Schedule demo Dec 9 2014
 * @brief Airline Flight Schedule Prototype
*/
package a8demo;

public class MainApp {

    public static void main(String[] args) {
        Menu menu = new Menu();
        menu.attach(" 1. Set Clock");
        menu.attach(" 2. Clear Schedule");
        menu.attach(" 3. Add Airline");
        menu.attach(" 4. Add Flight");
        menu.attach(" 5. Cancel Flight");
        menu.attach(" 6. Show Flight Info");
        menu.attach(" 7. Show Departures");
        menu.attach(" 8. Show Arrivals");
        menu.attach(" 9. Find Flights Between Two Airports");
        menu.attach("10. Exit");

        FlightSchedule schedule = new FlightSchedule();
        for (;;) {
            int choice = menu.getUserChoice();
            switch ( choice ) {
                case Menu.CHOICE_SET_CLOCK:
                    break;
                case Menu.CHOICE_CLEAR_SCHEDULE:
                    break;
                case Menu.CHOICE_ADD_AIRLINE:
                    menu.addAirline( schedule );
                    break;
                case Menu.CHOICE_ADD_FLIGHT:
                    menu.addFlight( schedule );
                    break;
                case Menu.CHOICE_CANCEL_FLIGHT:
                    break;
                case Menu.CHOICE_SHOW_FLIGHT_INFO:
                    break;
                case Menu.CHOICE_SHOW_DEPARTURES:
                    break;
                case Menu.CHOICE_SHOW_ARRIVALS:
                    menu.showArrivals( schedule );
                    break;
                case Menu.CHOICE_FIND_FLIGHTS:
                    break;
                case Menu.CHOICE_EXIT:
                    System.out.println("Goodbye!");
                    return;
                default:
                    System.out.println("Sorry, your response is invalid!, please retry!");
                    break;
            }//menu switch
            menu.pause();
        }//forever
    }//main


}//class MainApp