private List <Heli> HeliSelector(int selectedNation, int selectedRank)
        {
            this.selectedNation = selectedNation;
            this.selectedRank   = selectedRank;
            List <Heli> helisAll = HeliCollection.GetHeli();
            var         helivar  = from h in helisAll
                                   where h.NationId == selectedNation
                                   where h.RankId == selectedRank
                                   select h;

            return(helivar.ToList <Heli>());
        }
Beispiel #2
0
        private void _InfoSpinnerRank_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
        {
            selectedRank = ranks[e.Position].Id;

            if (selectedNation == 100 && selectedRank == 100)
            {
                helis       = HeliCollection.GetHeli();
                AdapterHeli = new HeliAdapter(this, helis);
                _InfoSpinnerHeli.Adapter = AdapterHeli;
            }
            else
            if (selectedNation == 100)
            {
                List <Heli> helisAll = HeliCollection.GetHeli();
                var         helivar  = from h in helisAll
                                       where h.RankId == selectedRank
                                       select h;
                helis       = helivar.ToList <Heli>();
                AdapterHeli = new HeliAdapter(this, helis);
                _InfoSpinnerHeli.Adapter = AdapterHeli;
            }
            else
            if (selectedRank == 100)
            {
                List <Heli> helisAll = HeliCollection.GetHeli();
                var         helivar  = from h in helisAll
                                       where h.NationId == selectedNation
                                       select h;
                helis       = helivar.ToList <Heli>();
                AdapterHeli = new HeliAdapter(this, helis);
                _InfoSpinnerHeli.Adapter = AdapterHeli;
            }
            else
            {
                helis       = HeliSelector(selectedNation, selectedRank);
                AdapterHeli = new HeliAdapter(this, helis);
                _InfoSpinnerHeli.Adapter = AdapterHeli;
            }
        }
 private void ListShower()
 {
     if (selectedNation == 100 && selectedRank == 100)
     {
         helisToListView          = HeliCollection.GetHeli();
         TheBestlistView          = new ListViewTheBestHeliAdapter(this, helisToListView);
         _TheBestListView.Adapter = TheBestlistView;
     }
     else
     if (selectedNation == 100)
     {
         List <Heli> helisAll = HeliCollection.GetHeli();
         var         helivar  = from h in helisAll
                                where h.RankId == selectedRank
                                select h;
         helisToListView          = helivar.ToList <Heli>();
         TheBestlistView          = new ListViewTheBestHeliAdapter(this, helisToListView);
         _TheBestListView.Adapter = TheBestlistView;
     }
     else
     if (selectedRank == 100)
     {
         List <Heli> helisAll = HeliCollection.GetHeli();
         var         helivar  = from h in helisAll
                                where h.NationId == selectedNation
                                select h;
         helisToListView          = helivar.ToList <Heli>();
         TheBestlistView          = new ListViewTheBestHeliAdapter(this, helisToListView);
         _TheBestListView.Adapter = TheBestlistView;
     }
     else
     {
         helisToListView          = HeliSelector(selectedNation, selectedRank);
         TheBestlistView          = new ListViewTheBestHeliAdapter(this, helisToListView);
         _TheBestListView.Adapter = TheBestlistView;
     }
 }
Beispiel #4
0
        private void TaskSelector()
        {
            if (SelectedPotentialTaskHeli == 1)
            {
                List <Heli> helisAll = HeliCollection.GetHeli();
                double      step     = 1.0;
                var         helivar  = from h in helisAll
                                       where h.BR <= selectedHeliBR + step && h.BR >= selectedHeliBR - step && h.NationId != selectedNation
                                       orderby h.MaxSpeed descending
                                       select h;
                helispotential        = helivar.ToList <Heli>();
                AdapterListView       = new ListViewInfoHeliAdapter(this, helispotential);
                _InfoListView.Adapter = AdapterListView;
            }

            if (SelectedPotentialTaskHeli == 2)
            {
                List <Heli> helisAll = HeliCollection.GetHeli();
                double      step     = 1.0;
                var         helivar  = from h in helisAll
                                       where h.BR <= selectedHeliBR + step && h.BR >= selectedHeliBR - step && h.NationId != selectedNation
                                       orderby h.ClimbTo1000 ascending
                                       select h;
                helispotential        = helivar.ToList <Heli>();
                AdapterListView       = new ListViewInfoHeliAdapter(this, helispotential);
                _InfoListView.Adapter = AdapterListView;
            }

            if (SelectedPotentialTaskHeli == 3)
            {
                List <Heli> helisAll = HeliCollection.GetHeli();
                double      step     = 1.0;
                var         helivar  = from h in helisAll
                                       where h.BR <= selectedHeliBR + step && h.BR >= selectedHeliBR - step && h.NationId != selectedNation
                                       orderby h.ThrustToWeightRatio descending
                                       select h;
                helispotential        = helivar.ToList <Heli>();
                AdapterListView       = new ListViewInfoHeliAdapter(this, helispotential);
                _InfoListView.Adapter = AdapterListView;
            }

            if (SelectedPotentialTaskHeli == 4)
            {
                List <Heli> helisAll = HeliCollection.GetHeli();
                double      step     = 1.0;
                var         helivar  = from h in helisAll
                                       where h.BR <= selectedHeliBR + step && h.BR >= selectedHeliBR - step && h.NationId != selectedNation
                                       orderby h.AGMCount descending
                                       select h;
                helispotential        = helivar.ToList <Heli>();
                AdapterListView       = new ListViewInfoHeliAdapter(this, helispotential);
                _InfoListView.Adapter = AdapterListView;
            }

            if (SelectedPotentialTaskHeli == 5)
            {
                List <Heli> helisAll = HeliCollection.GetHeli();
                double      step     = 1.0;
                var         helivar  = from h in helisAll
                                       where h.BR <= selectedHeliBR + step && h.BR >= selectedHeliBR - step && h.NationId != selectedNation
                                       orderby h.AGMArmorPenetration descending
                                       select h;
                helispotential        = helivar.ToList <Heli>();
                AdapterListView       = new ListViewInfoHeliAdapter(this, helispotential);
                _InfoListView.Adapter = AdapterListView;
            }

            if (SelectedPotentialTaskHeli == 6)
            {
                List <Heli> helisAll = HeliCollection.GetHeli();
                double      step     = 1.0;
                var         helivar  = from h in helisAll
                                       where h.BR <= selectedHeliBR + step && h.BR >= selectedHeliBR - step && h.NationId != selectedNation
                                       orderby h.AGMRange descending
                                       select h;
                helispotential        = helivar.ToList <Heli>();
                AdapterListView       = new ListViewInfoHeliAdapter(this, helispotential);
                _InfoListView.Adapter = AdapterListView;
            }

            if (SelectedPotentialTaskHeli == 7)
            {
                List <Heli> helisAll = HeliCollection.GetHeli();
                double      step     = 1.0;
                var         helivar  = from h in helisAll
                                       where h.BR <= selectedHeliBR + step && h.BR >= selectedHeliBR - step && h.NationId != selectedNation
                                       orderby h.ASMCount descending
                                       select h;
                helispotential        = helivar.ToList <Heli>();
                AdapterListView       = new ListViewInfoHeliAdapter(this, helispotential);
                _InfoListView.Adapter = AdapterListView;
            }
        }