Beispiel #1
0
        public Schedule(Airport from, Airport to, List<bool> day, int hour, int minute, int ground_departure, int flight, int ground_arrival)
        {
            this.Orgin = from;
            this.Destination = to;

            if (this.Orgin.location.Length() < this.Destination.location.Length())
            {
                this.route = new Route(this.Orgin, this.Destination);
                this.direction = true;
            }
            else
            {
                this.route = new Route(this.Destination, this.Orgin);
                this.direction = false;
            }
            this.Days = day;
            this.departure = 60*hour+ minute;
            this.boarding_time = ground_departure;
            this.deplane_time = ground_arrival;
            this.flight_time = flight;
            this.seats = 140;
            this.direction = true;
            this.arival = this.departure + this.flight_time;
            Schedule.total += 1;
            this.number = Schedule.total;

            // create Flight for the next 1 days (tomorrow (+1))
            this.create_Flight(Time.Today + 1);

            // sort Tabs again to make sure the list is sorted correctly
            globals.Flights.Sort();

        }
Beispiel #2
0
        public Window_tab( Texture2D open_texture, Texture2D closed_texture, Airport AIRPORT    ,Rectangle Position, Rectangle tab_position, bool open, Tab_type Type)
        {
            this.flights = new List<Flight>();
            this.selected = new Button(open_texture, tab_position);
            this.not_selected = new Button(closed_texture, tab_position);
            this.open = open;
            this.tab_location = tab_position;
            this.Location = Position;
            this.airport = AIRPORT;
            this.Type = Type;

            


            if (Type == Tab_type.departure)
            {
                for (int i = 0; i < globals.Flights.Count(); i++)
                {
                    bool departure = (globals.Flights[i].origin == this.airport);
                   
                    if (departure && !globals.Flights[i].flightComplete)
                    {
                        this.flights.Add(globals.Flights[i]);
                    }
                    
                }
                this.Title = "DEPARTURES";
                this.list = new List_items(this.flights, this.Location, list_type.airport_board_d);
            }

            else if (Type == Tab_type.arrival)
            {

                for (int i = 0; i < globals.Flights.Count(); i++)
                {
                    bool arrival = (globals.Flights[i].destination == this.airport);
                    
                    if (arrival && !globals.Flights[i].flightComplete)
                    {
                        this.flights.Add(globals.Flights[i]);
                    }
                }
                this.Title = "ARRIVALS";
                this.list = new List_items(this.flights, this.Location, list_type.airport_board_a);
            }
            // eventually we should change that to another type to give us a little more room and more details....
            

        }
Beispiel #3
0
        public Menu(Airport selected_airport, Rectangle location)
        {
            this.Type = 3;
            this.Text = new List<string>();
            this.background = globals.Airport_background;
            this.buttons = new List<Button>(1);

            this.buttons.Add(new Button(globals.button_Cancel, new Vector2(location.Center.X - 100, location.Bottom - 60), 50, 200));
            this.Location = location;
            this.returned = true; // Nothing to return

            this.textboxes = new List<TextBox>(0);
            this.checkboxes = new List<checkbox>(0);

            this.airport_window = selected_airport;
            this.tabs = new List<Window_tab>(3);
            

            

            this.tabs.Add(new Window_tab(globals.Window_Tab_open, globals.Window_Tab_closed, this.airport_window,new Rectangle(this.Location.Left + 50, this.Location.Top + 100, 500, 300), new Rectangle(this.Location.Left + 50, this.Location.Top + 20, 150, 30),true,Tab_type.departure));
            this.tabs.Add(new Window_tab(globals.Window_Tab_open, globals.Window_Tab_closed, this.airport_window, new Rectangle(this.Location.Left + 50, this.Location.Top + 100, 500, 300), new Rectangle(this.Location.Left + 200, this.Location.Top + 20, 100, 30),false,Tab_type.arrival));
            //this.tabs.Add(new Window_tab(globals.Window_Tab_open, globals.Window_Tab_closed, this.airport_window, new Rectangle(this.Location.Left + 50, this.Location.Top + 100, 500, 300), new Rectangle(this.Location.Left + 150, this.Location.Top + 20, 100, 30), false, Tab_type.enginnering));

        }
Beispiel #4
0
 public Route(Airport origin, Airport destination)
 {
     this.origin = origin;
     this.destination = destination;
     calculate_line();
 }