public PageShowFlightSchool(FlightSchool fs)
        {
            this.FlightSchool = new FlightSchoolMVVM(fs);
            this.DataContext = this.FlightSchool;

            setHireStudentsStatus();

            InitializeComponent();
        }
        public FlightSchoolMVVM(FlightSchool fs)
        {
            this.FlightSchool = fs;

            this.Students = new ObservableCollection<PilotStudent>();
            this.Aircrafts = new ObservableCollection<TrainingAircraft>();
            this.Instructors = new ObservableCollection<Instructor>();

            this.FlightSchool.Students.ForEach(s => this.Students.Add(s));
            this.FlightSchool.TrainingAircrafts.ForEach(a => this.Aircrafts.Add(a));
            this.FlightSchool.Instructors.ForEach(i => this.Instructors.Add(i));
        }
        public PageShowFlightSchool(FlightSchool fs)
        {
            this.FlightSchool = new FlightSchoolMVVM(fs);
            this.Instructors = new ObservableCollection<Instructor>();
            this.AirlinerFamilies = AirlinerTypes.GetTypes(t => t.Produced.From.Year <= GameObject.GetInstance().GameTime.Year && t.Produced.To > GameObject.GetInstance().GameTime.AddYears(-30)).Select(t => t.AirlinerFamily).Distinct().OrderBy(a => a).ToList();

            this.DataContext = this.FlightSchool;

            setHireStudentsStatus();

            InitializeComponent();
        }
        public PanelFlightSchool(PagePilots parent, FlightSchool flighschool)
        {
            this.ParentPage = parent;
            this.FlightSchool = flighschool;

            InitializeComponent();

            StackPanel panelFlightSchool = new StackPanel();

            TextBlock txtHeader = new TextBlock();
            txtHeader.Uid = "1001";
            txtHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            txtHeader.SetResourceReference(TextBlock.BackgroundProperty, "HeaderBackgroundBrush2");
            txtHeader.FontWeight = FontWeights.Bold;
            txtHeader.Text = Translator.GetInstance().GetString("PanelFlightSchool", txtHeader.Uid);

            panelFlightSchool.Children.Add(txtHeader);

            ListBox lbFSInformation = new ListBox();
            lbFSInformation.SetResourceReference(ListBox.ItemTemplateProperty, "QuickInfoItem");
            lbFSInformation.ItemContainerStyleSelector = new ListBoxItemStyleSelector();

            lbFSInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelFlightSchool", "1002"), UICreator.CreateTextBlock(this.FlightSchool.Name)));
            lbFSInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelFlightSchool", "1003"), UICreator.CreateTextBlock(this.FlightSchool.NumberOfInstructors.ToString())));

            txtStudents = UICreator.CreateTextBlock(this.FlightSchool.NumberOfStudents.ToString());
            lbFSInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelFlightSchool", "1006"), txtStudents));

            txtTrainingAircrafts = UICreator.CreateTextBlock(this.FlightSchool.TrainingAircrafts.Count.ToString());
            lbFSInformation.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PanelFlightSchool", "1009"), txtTrainingAircrafts));

            panelFlightSchool.Children.Add(lbFSInformation);
            panelFlightSchool.Children.Add(createInstructorsPanel());
            panelFlightSchool.Children.Add(createTrainingAircraftsPanel());
            panelFlightSchool.Children.Add(createStudentsPanel());

            panelFlightSchool.Children.Add(createButtonsPanel());

            this.Content = panelFlightSchool;

            showInstructors();
            showStudents();
            showTrainingAircrafts();
        }
        private void btnBuild_Click(object sender, RoutedEventArgs e)
        {
            double price = GeneralHelpers.GetInflationPrice(267050);

            ComboBox cbAirport = new ComboBox();
            cbAirport.SetResourceReference(ComboBox.StyleProperty, "ComboBoxTransparentStyle");
            cbAirport.Width = 200;
            cbAirport.SelectedValuePath = "Profile.Town.Name";
            cbAirport.DisplayMemberPath = "Profile.Town.Name";
            cbAirport.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;

            List<Airport> homeAirports = GameObject.GetInstance().HumanAirline.Airports.FindAll(a => a.getCurrentAirportFacility(GameObject.GetInstance().HumanAirline, AirportFacility.FacilityType.Service).TypeLevel > 0);
            homeAirports.AddRange(GameObject.GetInstance().HumanAirline.Airports.FindAll(a => a.IsHub)); //hubs
            homeAirports = homeAirports.Distinct().ToList();

            foreach (Airport airport in homeAirports)
            {
                if (GameObject.GetInstance().HumanAirline.FlightSchools.Find(f => f.Airport == airport) == null)
                    cbAirport.Items.Add(airport);
            }

            cbAirport.SelectedIndex = 0;

            if (PopUpSingleElement.ShowPopUp(Translator.GetInstance().GetString("PagePilots", "1004"), cbAirport) == PopUpSingleElement.ButtonSelected.OK && cbAirport.SelectedItem != null)
            {
                Airport airport = (Airport)cbAirport.SelectedItem;

                FlightSchool fs = new FlightSchool(airport);

                GameObject.GetInstance().HumanAirline.addFlightSchool(fs);
                this.FlightSchools.Add(fs);

                AirlineHelpers.AddAirlineInvoice(GameObject.GetInstance().HumanAirline, GameObject.GetInstance().GameTime, Invoice.InvoiceType.Airline_Expenses, -price);

                ICollectionView view = CollectionViewSource.GetDefaultView(lvInstructors.ItemsSource);
                view.Refresh();

            }
        }
Exemple #6
0
        public void removeFlightSchool(FlightSchool school)
        {
            this.FlightSchools.Remove(school);

            foreach (Instructor instructor in school.Instructors)
                instructor.FlightSchool = null;
        }
Exemple #7
0
 //adds a flight school to the airline
 public void addFlightSchool(FlightSchool school)
 {
     this.FlightSchools.Add(school);
 }
 public TrainingAircraft(TrainingAircraftType type, DateTime boughtDate, FlightSchool flighschool)
 {
     this.Type = type;
     this.FlightSchool = flighschool;
     this.BoughtDate = boughtDate;
 }
        //loads an airline from the saved file
        private static void LoadAirline(XmlElement airlineNode)
        {
            // chs, 2011-21-10 changed for the possibility of creating a new airline
            string airlineName = airlineNode.Attributes["name"].Value;
            string airlineIATA = airlineNode.Attributes["code"].Value;

            Boolean airlineIsSubsidiary = Convert.ToBoolean(airlineNode.Attributes["subsidiary"].Value);
            Country airlineCountry = Countries.GetCountry(airlineNode.Attributes["country"].Value);
            string color = airlineNode.Attributes["color"].Value;
            string airlineCEO = airlineNode.Attributes["CEO"].Value;
            double money = Convert.ToDouble(airlineNode.Attributes["money"].Value, new CultureInfo("de-DE", false));
            int reputation = Convert.ToInt16(airlineNode.Attributes["reputation"].Value);
            Airline.AirlineMentality mentality = (Airline.AirlineMentality)Enum.Parse(typeof(Airline.AirlineMentality), airlineNode.Attributes["mentality"].Value);
            Airline.AirlineFocus market = (Airline.AirlineFocus)Enum.Parse(typeof(Airline.AirlineFocus), airlineNode.Attributes["market"].Value);
            Airline.AirlineLicense license = (Airline.AirlineLicense)Enum.Parse(typeof(Airline.AirlineLicense), airlineNode.Attributes["license"].Value);
            Route.RouteType routefocus = airlineNode.HasAttribute("routefocus") ? (Route.RouteType)Enum.Parse(typeof(Route.RouteType), airlineNode.Attributes["routefocus"].Value) : Route.RouteType.Passenger;

            Boolean isReal = airlineNode.HasAttribute("real") ? Convert.ToBoolean(airlineNode.Attributes["real"].Value) : true;
            int founded = airlineNode.HasAttribute("founded") ? Convert.ToInt16(airlineNode.Attributes["founded"].Value) : 1950;
            int folded = airlineNode.HasAttribute("folded") ? Convert.ToInt16(airlineNode.Attributes["folded"].Value) : 2199;

            Airline airline;
            if (airlineIsSubsidiary)
            {
                Airline parent = Airlines.GetAirline(airlineNode.Attributes["parentairline"].Value);
                airline = new SubsidiaryAirline(parent, new AirlineProfile(airlineName, airlineIATA, color, airlineCEO, isReal, founded, folded), mentality, market, license, routefocus);
                airline.Profile.Country = airlineCountry;
                parent.addSubsidiaryAirline((SubsidiaryAirline)airline);
            }
            else
            {
                airline = new Airline(new AirlineProfile(airlineName, airlineIATA, color, airlineCEO, isReal, founded, folded), mentality, market, license, routefocus);
                airline.Profile.Country = airlineCountry;
            }
            if (airlineNode.HasAttribute("logo"))
            {
                string logo = AppSettings.getDataPath() + "\\graphics\\airlinelogos\\" + airlineNode.Attributes["logo"].Value;

                airline.Profile.addLogo(new AirlineLogo(logo));
            }
            airline.Fleet.Clear();
            airline.Airports.Clear();
            airline.Routes.Clear();
            airline.Alliances.Clear();

            airline.Money = money;
            airline.Reputation = reputation;

            XmlNodeList logosList = airlineNode.SelectNodes("logos/logo");

            foreach (XmlElement logoElement in logosList)
            {
                int logoFromYear = Convert.ToInt16(logoElement.Attributes["from"].Value);
                int logoToYear = Convert.ToInt16(logoElement.Attributes["to"].Value);
                string logoPath = logoElement.Attributes["path"].Value;

                if (!File.Exists(logoPath))
                    logoPath = AppSettings.getDataPath() + "\\graphics\\airlinelogos\\" + logoPath.Substring(logoPath.LastIndexOf('\\') + 1);

                airline.Profile.addLogo(new AirlineLogo(logoFromYear, logoToYear, logoPath));
            }

            XmlElement airlineContractNode = (XmlElement)airlineNode.SelectSingleNode("contract");
            if (airlineContractNode != null)
            {
                Manufacturer contractManufacturer = Manufacturers.GetManufacturer(airlineContractNode.Attributes["manufacturer"].Value);
                DateTime contractSigningDate = DateTime.Parse(airlineContractNode.Attributes["signingdate"].Value, new CultureInfo("de-DE", false));
                int contractLength = Convert.ToInt16(airlineContractNode.Attributes["length"].Value);
                double contractDiscount = Convert.ToDouble(airlineContractNode.Attributes["discount"].Value, new CultureInfo("de-DE", false));
                int contractAirliners = Convert.ToInt16(airlineContractNode.Attributes["airliners"].Value);

                ManufacturerContract contract = new ManufacturerContract(contractManufacturer, contractSigningDate, contractLength, contractDiscount);
                contract.PurchasedAirliners = contractAirliners;

                airline.Contract = contract;

            }

            // chs, 2011-17-10 added for loading of passenger happiness
            XmlElement airlinePassengerNode = (XmlElement)airlineNode.SelectSingleNode("passengerhappiness");
            double passengerHappiness = Convert.ToDouble(airlinePassengerNode.Attributes["value"].Value, new CultureInfo("de-DE", false));
            PassengerHelpers.SetPassengerHappiness(airline, passengerHappiness);

            XmlNodeList airlineFacilitiesList = airlineNode.SelectNodes("facilities/facility");
            foreach (XmlElement airlineFacilityNode in airlineFacilitiesList)
            {
                string airlineFacility = airlineFacilityNode.Attributes["uid"].Value;

                airline.addFacility(AirlineFacilities.GetFacility(airlineFacility));
            }

            XmlNodeList airlinePoliciesList = airlineNode.SelectNodes("policies/policy");

            foreach (XmlElement airlinePolicyNode in airlinePoliciesList)
            {
                string policyName = airlinePolicyNode.Attributes["name"].Value;
                object policyValue = (object)airlinePolicyNode.Attributes["value"].Value;

                int number;
                if (int.TryParse(policyValue.ToString(), out number))
                    airline.addAirlinePolicy(new AirlinePolicy(policyName, number));
                else
                    airline.addAirlinePolicy(new AirlinePolicy(policyName, policyValue));
            }

            XmlNodeList airlineLoanList = airlineNode.SelectNodes("loans/loan");
            foreach (XmlElement airlineLoanNode in airlineLoanList)
            {
                DateTime date = DateTime.Parse(airlineLoanNode.Attributes["date"].Value, new CultureInfo("de-DE", false));
                double rate = Convert.ToDouble(airlineLoanNode.Attributes["rate"].Value, new CultureInfo("de-DE", false));
                double amount = Convert.ToDouble(airlineLoanNode.Attributes["amount"].Value, new CultureInfo("de-DE", false));
                int length = Convert.ToInt16(airlineLoanNode.Attributes["length"].Value);
                double payment = Convert.ToDouble(airlineLoanNode.Attributes["payment"].Value, new CultureInfo("de-DE", false));

                Loan loan = new Loan(date, amount, length, rate);
                loan.PaymentLeft = payment;

                airline.addLoan(loan);
            }

            XmlNodeList airlineStatList = airlineNode.SelectNodes("stats/stat");
            foreach (XmlElement airlineStatNode in airlineStatList)
            {
                int year = Convert.ToInt32(airlineStatNode.Attributes["year"].Value);
                string airlineStatType = airlineStatNode.Attributes["type"].Value;
                double value = Convert.ToDouble(airlineStatNode.Attributes["value"].Value, new CultureInfo("de-DE", false));

                airline.Statistics.setStatisticsValue(year, StatisticsTypes.GetStatisticsType(airlineStatType), value);
            }

            XmlNodeList airlineInvoiceList = airlineNode.SelectNodes("invoices/invoice");

            foreach (XmlElement airlineInvoiceNode in airlineInvoiceList)
            {
                Invoice.InvoiceType type = (Invoice.InvoiceType)Enum.Parse(typeof(Invoice.InvoiceType), airlineInvoiceNode.Attributes["type"].Value);
                int invoiceYear = Convert.ToInt16(airlineInvoiceNode.Attributes["year"].Value);
                int invoiceMonth = Convert.ToInt16(airlineInvoiceNode.Attributes["month"].Value);
                double invoiceAmount = Convert.ToDouble(airlineInvoiceNode.Attributes["amount"].Value, new CultureInfo("de-DE", false));

                airline.setInvoice(type, invoiceYear, invoiceMonth, invoiceAmount);
            }

            // chs, 2011-13-10 added for loading of airline advertisements
            XmlNodeList advertisementList = airlineNode.SelectNodes("advertisements/advertisement");

            foreach (XmlElement advertisementNode in advertisementList)
            {
                AdvertisementType.AirlineAdvertisementType type = (AdvertisementType.AirlineAdvertisementType)Enum.Parse(typeof(AdvertisementType.AirlineAdvertisementType), advertisementNode.Attributes["type"].Value);
                string advertisementName = advertisementNode.Attributes["name"].Value;

                airline.setAirlineAdvertisement(AdvertisementTypes.GetType(type, advertisementName));
            }
            // chs, 2011-17-10 added for loading of fees
            AirlineFees fees = new AirlineFees();

            XmlNodeList airlineFeeList = airlineNode.SelectNodes("fees/fee");
            foreach (XmlElement feeNode in airlineFeeList)
            {
                string feeType = feeNode.Attributes["type"].Value;
                double feeValue = Convert.ToDouble(feeNode.Attributes["value"].Value, new CultureInfo("de-DE", false));

                fees.setValue(FeeTypes.GetType(feeType), feeValue);
            }

            airline.Fees = fees;

            XmlNodeList flightschoolsList = airlineNode.SelectNodes("flightschools/flightschool");

            foreach (XmlElement flightschoolNode in flightschoolsList)
            {
                string fsID = flightschoolNode.Attributes["id"].Value;
                Airport fsAirport = Airports.GetAirportFromID(flightschoolNode.Attributes["airport"].Value);

                FlightSchool fs = new FlightSchool(fsAirport);
                fs.ID = fsID;

                XmlNodeList aircraftsList = flightschoolNode.SelectNodes("trainingaircrafts/trainingaircraft");

                foreach (XmlElement aircraftNode in aircraftsList)
                {
                    TrainingAircraftType aircraftType = TrainingAircraftTypes.GetAircraftType(aircraftNode.Attributes["type"].Value);
                    DateTime aircraftDate = DateTime.Parse(aircraftNode.Attributes["date"].Value, new CultureInfo("de-DE", false));

                    fs.addTrainingAircraft(new TrainingAircraft(aircraftType, aircraftDate, fs));
                }

                XmlNodeList studentsList = flightschoolNode.SelectNodes("students/student");

                foreach (XmlElement studentNode in studentsList)
                {
                    string firstname = studentNode.Attributes["firstname"].Value;
                    string lastname = studentNode.Attributes["lastname"].Value;
                    DateTime birthdate = DateTime.Parse(studentNode.Attributes["birthdate"].Value, new CultureInfo("de-DE", false));
                    Town town = Towns.GetTown(studentNode.Attributes["town"].Value);
                    DateTime startdate = DateTime.Parse(studentNode.Attributes["startdate"].Value, new CultureInfo("de-DE", false));

                    fs.addStudent(new PilotStudent(new PilotProfile(firstname, lastname, birthdate, town), startdate, null,null,""));
                }

                airline.addFlightSchool(fs);
            }

            XmlNodeList airlineFleetList = airlineNode.SelectNodes("fleet/airliner");

            foreach (XmlElement airlineAirlinerNode in airlineFleetList)
            {
                Airliner airliner = Airliners.GetAirliner(airlineAirlinerNode.Attributes["airliner"].Value);

                string fAirlinerName = airlineAirlinerNode.Attributes["name"].Value;
                Airport homebase = Airports.GetAirport(airlineAirlinerNode.Attributes["homebase"].Value);
                FleetAirliner.PurchasedType purchasedtype = (FleetAirliner.PurchasedType)Enum.Parse(typeof(FleetAirliner.PurchasedType), airlineAirlinerNode.Attributes["purchased"].Value);
                DateTime purchasedDate = DateTime.Parse(airlineAirlinerNode.Attributes["date"].Value, new CultureInfo("de-DE", false));
                FleetAirliner.AirlinerStatus status = (FleetAirliner.AirlinerStatus)Enum.Parse(typeof(FleetAirliner.AirlinerStatus), airlineAirlinerNode.Attributes["status"].Value);
                DateTime groundedDate = DateTime.Parse(airlineAirlinerNode.Attributes["groundeddate"].Value, new CultureInfo("de-DE", false));

               // Coordinate latitude = Coordinate.Parse(airlineAirlinerNode.Attributes["latitude"].Value);
                //Coordinate longitude = Coordinate.Parse(airlineAirlinerNode.Attributes["longitude"].Value);

                string[] latitude = airlineAirlinerNode.Attributes["value"].Value.Split(new Char[] { '°', '\'', '\'' });
                string[] longitude = airlineAirlinerNode.Attributes["value"].Value.Split(new Char[] { '°', '\'', '\'' });
                int[] coords = new int[6];
                foreach (string l in latitude)
                {
                    int c = 0;
                    int.TryParse(l, out coords[c]);
                    c++;
                }

                foreach (string l in longitude)
                {
                    int c = 3;
                    int.TryParse(l, out coords[c]);
                    c++;
                }

                //cleaning up
                latitude = null;
                longitude = null;

                GeoCoordinate pos = new GeoCoordinate(MathHelpers.DMStoDeg(coords[0], coords[1], coords[2]), MathHelpers.DMStoDeg(coords[3], coords[4], coords[5]));

                FleetAirliner fAirliner = new FleetAirliner(purchasedtype, purchasedDate, airline, airliner, homebase);
                fAirliner.CurrentPosition = null;
                fAirliner.Status = status;
                fAirliner.GroundedToDate = groundedDate;

                XmlNodeList airlinerStatList = airlineAirlinerNode.SelectNodes("stats/stat");

                foreach (XmlElement airlinerStatNode in airlinerStatList)
                {
                    int year = Convert.ToInt32(airlinerStatNode.Attributes["year"].Value);
                    string statType = airlinerStatNode.Attributes["type"].Value;
                    double statValue = Convert.ToDouble(airlinerStatNode.Attributes["value"].Value, new CultureInfo("de-DE", false));
                    fAirliner.Statistics.setStatisticsValue(year, StatisticsTypes.GetStatisticsType(statType), statValue);
                }

                airline.addAirliner(fAirliner);

            }
            XmlNodeList routeList = airlineNode.SelectNodes("routes/route");

            foreach (XmlElement routeNode in routeList)
            {
                airline.addRoute(LoadRoute(routeNode, airline));
            }

            XmlNodeList flightNodes = airlineNode.SelectNodes("flights/flight");
            foreach (XmlElement flightNode in flightNodes)
            {

                FleetAirliner airliner = airline.Fleet.Find(a => a.Airliner.ID == flightNode.Attributes["airliner"].Value);

                if (airliner != null)
                {
                    Route route = airline.Routes.Find(r => r.Id == flightNode.Attributes["route"].Value);

                    if (route != null)
                    {
                        string destination = flightNode.Attributes["destination"].Value;

                        DayOfWeek day = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), flightNode.Attributes["day"].Value);
                        TimeSpan time = TimeSpan.Parse(flightNode.Attributes["time"].Value);
                        DateTime flightTime = DateTime.Parse(flightNode.Attributes["flighttime"].Value, new CultureInfo("de-DE", false));

                        XmlElement stopoverNode = (XmlElement)flightNode.SelectSingleNode("stopover");

                        Boolean isStopoverFlight = stopoverNode != null;

                        if (destination != "Service")
                        {
                            RouteTimeTableEntry rtte = route.TimeTable.Entries.Find(delegate(RouteTimeTableEntry e) { return e.Destination.FlightCode == destination && e.Day == day && e.Time == time; });

                            Flight currentFlight = new Flight(rtte);
                            currentFlight.FlightTime = flightTime;
                            currentFlight.Classes.Clear();

                            if (currentFlight.isPassengerFlight())
                            {
                                XmlNodeList flightClassList = flightNode.SelectNodes("flightclasses/flightclass");

                                foreach (XmlElement flightClassNode in flightClassList)
                                {
                                    AirlinerClass.ClassType airlinerClassType = (AirlinerClass.ClassType)Enum.Parse(typeof(AirlinerClass.ClassType), flightClassNode.Attributes["type"].Value);
                                    int flightPassengers = Convert.ToInt16(flightClassNode.Attributes["passengers"].Value);

                                    currentFlight.Classes.Add(new FlightAirlinerClass(((PassengerRoute)route).getRouteAirlinerClass(airlinerClassType), flightPassengers));
                                }

                            }
                            if (currentFlight.isCargoFlight())
                            {
                                XmlElement flightCargoNode = (XmlElement)flightNode.SelectSingleNode("flightcargo");
                                double flightCargo = Convert.ToDouble(flightCargoNode.Attributes["cargo"].Value, new CultureInfo("de-DE", false));

                                currentFlight.Cargo = flightCargo;

                            }
                            if (isStopoverFlight)
                            {
                                int currentStopoverFlight = Convert.ToInt32(stopoverNode.Attributes["currentflight"].Value);

                                XmlNodeList stopoverClassesList = stopoverNode.SelectNodes("classes/class");

                                Dictionary<RouteTimeTableEntry, List<FlightAirlinerClass>> stopEntryAllClasses = new Dictionary<RouteTimeTableEntry, List<FlightAirlinerClass>>();

                                foreach (XmlElement stopoverClassNode in stopoverClassesList)
                                {

                                    RouteTimeTableEntry stopoverEntry = airline.Routes.SelectMany(r => r.TimeTable.Entries).ToList().Find(e => e.ID == stopoverClassNode.Attributes["id"].Value);

                                    List<FlightAirlinerClass> stopoverFlightClasses = new List<FlightAirlinerClass>();

                                    XmlNodeList stopoverFlightClassList = stopoverClassNode.SelectNodes("flightclasses/flightclass");

                                    foreach (XmlElement stopoverFlightClassNode in stopoverFlightClassList)
                                    {
                                        AirlinerClass.ClassType stopoverAirlinerClassType = (AirlinerClass.ClassType)Enum.Parse(typeof(AirlinerClass.ClassType), stopoverFlightClassNode.Attributes["type"].Value);
                                        int stopoverFlightPassengers = Convert.ToInt16(stopoverFlightClassNode.Attributes["passengers"].Value);

                                        stopoverFlightClasses.Add(new FlightAirlinerClass(((PassengerRoute)route).getRouteAirlinerClass(stopoverAirlinerClassType), stopoverFlightPassengers));

                                    }

                                    stopEntryAllClasses.Add(stopoverEntry, stopoverFlightClasses);

                                }

                                XmlNodeList stopoverCargosList = stopoverNode.SelectNodes("cargos/cargo");

                                Dictionary<RouteTimeTableEntry, double> stopEntryAllCargo = new Dictionary<RouteTimeTableEntry, double>();

                                foreach (XmlElement stopoverCargoNode in stopoverCargosList)
                                {

                                    RouteTimeTableEntry stopoverEntry = airline.Routes.SelectMany(r => r.TimeTable.Entries).ToList().Find(e => e.ID == stopoverCargoNode.Attributes["id"].Value);
                                    double cargoValue = Convert.ToDouble(stopoverCargoNode.Attributes["value"].Value, new CultureInfo("de-DE", false));

                                    stopEntryAllCargo.Add(stopoverEntry, cargoValue);

                                }

                                StopoverFlight stopoverFlight = new StopoverFlight(rtte);
                                stopoverFlight.AllClasses = stopEntryAllClasses;
                                stopoverFlight.AllCargo = stopEntryAllCargo;
                                stopoverFlight.CurrentFlight = currentStopoverFlight;
                                stopoverFlight.FlightTime = currentFlight.FlightTime;
                                stopoverFlight.Classes = currentFlight.Classes;

                                airliner.CurrentFlight = stopoverFlight;

                            }
                            else
                            {

                                airliner.CurrentFlight = currentFlight;
                            }
                        }
                        else
                        {

                            airliner.CurrentFlight = new Flight(new RouteTimeTableEntry(route.TimeTable, GameObject.GetInstance().GameTime.DayOfWeek, GameObject.GetInstance().GameTime.TimeOfDay, new RouteEntryDestination(airliner.Homebase, "Service",null),null));

                            airliner.Status = FleetAirliner.AirlinerStatus.On_service;
                        }

                    }
                    else
                        airliner.Status = FleetAirliner.AirlinerStatus.Stopped;
                }

            }
            Airlines.AddAirline(airline);
        }
 public TrainingAircraft(TrainingAircraftType type, DateTime boughtDate, FlightSchool flighschool)
 {
     this.Type         = type;
     this.FlightSchool = flighschool;
     this.BoughtDate   = boughtDate;
 }