// Nick Cash
// Assignment #3
// 810:062-2

#ifndef INC_MAIN
#define INC_MAIN

#include <iostream>
#include <map>

using namespace std;

// needed for flights and people
typedef map< string, string > StringMap;

// person information
class cPerson
{
  public:
          cPerson();
          cPerson(string);
         ~cPerson();
        
          string Get(string);
          bool Set(string x, string y);
        
  private:
          StringMap data;
};

// needed for flights
typedef map< int, cPerson *> SeatMap;

// holds the important info
class cFlight
{
   public:
            cFlight();
            cFlight( string );
           ~cFlight();

            string GetName() const { return name; }
            
            string GetCity( string s )
            {
              if ( !s.empty() )
               return cities[s];
              else
               return "";
            }
            
            bool AddMenu( string, string );
            bool AddCrew( string, string );
            bool AddCity( string, string );
            
            bool AssignSeat( string, int, cPerson *);
            bool FreeSeat( string, int );
            
            void Print(bool = true, bool = true, bool = true, bool = true );
         
   private:
            string           name;
            
            StringMap        menu;   // meals
            StringMap        crew;   // captain, HFA, co-cap
            StringMap        cities; // origin, destination
            SeatMap          aisle_seats;
            SeatMap          window_seats;
};

// used for airline class
typedef map<string, cFlight * > FlightMap;

// topdog class
class cAirline
{
   public:
          cAirline();
         ~cAirline();

          bool CreateFlight( string );
          bool DeleteFlight( string );
          
          void PrintFlights( bool = false, bool = false );
          void PrintFlightsByCity( string );
          void PrintPassengers(string, bool = false);

          cFlight* GetFlight( string );

          // data addition without needing to use Getflight
          // flight, position/key, name
          bool SetCrew( string, string, string );
          bool SetCity( string, string, string );
          bool SetMenu( string, string, string );
          bool SetSeat( string, string, int, cPerson *);
          bool FreeSeat( string, string, int );
          
   private:
          FlightMap flights;
};

#endif // inclusion guard
