Esempio n. 1
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....
            

        }
Esempio n. 2
0
        public bool Update(MouseState state)
        {
            if (this.open)
            {
                this.flights = new List<Flight>();

                if (this.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]);
                        }

                    }
                }
                else if (Type == Tab_type.arrival)
                {

                    this.flights = new List<Flight>();

                    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.list = new List_items(this.flights, this.Location, list_type.airport_board_a);
                }

                this.list.Update(state);
                
            }
            //Update list
            else
            {
                if (this.not_selected.Pressed(state))
                {
                    this.open = true;
                    return true;
                }
            }

            return false; 
            //this should return true if we tried to open it so we know all other ones have to close....
        }
Esempio n. 3
0
        public void Set_list(List<Airliner> list_items, Rectangle location)
        {
            this.list_type = 3;
            this.list = new List_items(list_items, location, A_sim_V1.list_type.side_tab);

        }
Esempio n. 4
0
        public void Set_list(List<Flight> list_items, Rectangle location)
        {
            this.list_type = 4;
            this.list = new List_items(list_items, location, A_sim_V1.list_type.side_tab);
            

        }
Esempio n. 5
0
        public void Set_list(List<Schedule> list_items, Rectangle location)
        {
            this.list_type = 2;
            list = new List_items(list_items, location, A_sim_V1.list_type.side_tab);

        }