private void LoadListPlanesAndTanks() { var planes = PlaneCollection.GetPlanes(); var tanks = TankCollection.GetTanks(); planes.AddRange(tanks); vehicles = planes; }
private TankCollection<string> MockTankCollectionData() { TankCollection<string> tankCollection = new TankCollection<string>() { "tankCollection1", "tankCollection2" }; tankCollection.CollectionName = "tankCollection"; return tankCollection; }
private List <Tank> TankSelector(int selectedNation, int selectedRank) { this.selectedNation = selectedNation; this.selectedRank = selectedRank; List <Tank> tanksAll = TankCollection.GetTank(); var tankvar = from p in tanksAll where p.NationId == selectedNation where p.RankId == selectedRank select p; return(tankvar.ToList <Tank>()); }
private void ListShower() { if (selectedNation == 100 && selectedRank == 100) { tanksToListView = TankCollection.GetTank(); TheBestlistView = new ListViewTheBestTankAdapter(this, tanksToListView); _TheBestListView.Adapter = TheBestlistView; } else if (selectedNation == 100) { List <Tank> tanksAll = TankCollection.GetTank(); var tankvar = from p in tanksAll where p.RankId == selectedRank select p; tanksToListView = tankvar.ToList <Tank>(); TheBestlistView = new ListViewTheBestTankAdapter(this, tanksToListView); _TheBestListView.Adapter = TheBestlistView; } else if (selectedRank == 100) { List <Tank> tanksAll = TankCollection.GetTank(); var tankvar = from p in tanksAll where p.NationId == selectedNation select p; tanksToListView = tankvar.ToList <Tank>(); TheBestlistView = new ListViewTheBestTankAdapter(this, tanksToListView); _TheBestListView.Adapter = TheBestlistView; } else { tanksToListView = TankSelector(selectedNation, selectedRank); TheBestlistView = new ListViewTheBestTankAdapter(this, tanksToListView); _TheBestListView.Adapter = TheBestlistView; } }
private void _InfoSpinnerNation_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e) { selectedNation = nations[e.Position].Id; if (selectedNation == 100 && selectedRank == 100) { tanks = TankCollection.GetTank(); AdapterTank = new TankAdapter(this, tanks); _InfoSpinnerTank.Adapter = AdapterTank; } else if (selectedNation == 100) { List <Tank> tanksAll = TankCollection.GetTank(); var tankvar = from p in tanksAll where p.RankId == selectedRank select p; tanks = tankvar.ToList <Tank>(); AdapterTank = new TankAdapter(this, tanks); _InfoSpinnerTank.Adapter = AdapterTank; } else if (selectedRank == 100) { List <Tank> tanksAll = TankCollection.GetTank(); var tankvar = from p in tanksAll where p.NationId == selectedNation select p; tanks = tankvar.ToList <Tank>(); AdapterTank = new TankAdapter(this, tanks); _InfoSpinnerTank.Adapter = AdapterTank; } else { tanks = TankSelector(selectedNation, selectedRank); AdapterTank = new TankAdapter(this, tanks); _InfoSpinnerTank.Adapter = AdapterTank; } }
private List<Tank> MockTankData() { TankCollection<string> tankCollection1 = new TankCollection<string>(); tankCollection1.CollectionName = "Collection1"; tankCollection1.Add("String1"); tankCollection1.Add("String2"); TankCollection<Navigation<string>> navigationTankCollection = new TankCollection<Navigation<string>> { new Navigation<string> { Obj = "String1" }, new Navigation<string> { Obj = "String2" } }; return new List<Tank>() { new Tank() { CanDive = true, Speed = 50, Weight = 100, TankCollection = tankCollection1, History = new List<string>() { "History1", "History2" } }, new Tank() { CanDive = false, Weight = 100, History = new List<string>() { "History1", "History2" }, } }; }
private void TaskSelector() { if (SelectedPotentialTask == 1) { List <Tank> tanksAll = TankCollection.GetTank(); double step = 1.0; var tankvar = from p in tanksAll where p.BR <= selectedTankBR + step && p.BR >= selectedTankBR - step && p.NationId != selectedNation orderby p.MaxSpeedAtTerrain descending select p; tankspotential = tankvar.ToList <Tank>(); AdapterListView = new ListViewInfoTankAdapter(this, tankspotential); _InfoListView.Adapter = AdapterListView; } if (SelectedPotentialTask == 2) { List <Tank> tanksAll = TankCollection.GetTank(); double step = 1.0; var tankvar = from p in tanksAll where p.BR <= selectedTankBR + step && p.BR >= selectedTankBR - step && p.NationId != selectedNation orderby p.AccelerationTo100 ascending select p; tankspotential = tankvar.ToList <Tank>(); AdapterListView = new ListViewInfoTankAdapter(this, tankspotential); _InfoListView.Adapter = AdapterListView; } if (SelectedPotentialTask == 3) { List <Tank> tanksAll = TankCollection.GetTank(); double step = 1.0; var tankvar = from p in tanksAll where p.BR <= selectedTankBR + step && p.BR >= selectedTankBR - step && p.NationId != selectedNation orderby p.PowerToWeightRatio descending select p; tankspotential = tankvar.ToList <Tank>(); AdapterListView = new ListViewInfoTankAdapter(this, tankspotential); _InfoListView.Adapter = AdapterListView; } if (SelectedPotentialTask == 4) { List <Tank> tanksAll = TankCollection.GetTank(); double step = 1.0; var tankvar = from p in tanksAll where p.BR <= selectedTankBR + step && p.BR >= selectedTankBR - step && p.NationId != selectedNation orderby p.Penetration descending select p; tankspotential = tankvar.ToList <Tank>(); AdapterListView = new ListViewInfoTankAdapter(this, tankspotential); _InfoListView.Adapter = AdapterListView; } if (SelectedPotentialTask == 5) { List <Tank> tanksAll = TankCollection.GetTank(); double step = 1.0; var tankvar = from p in tanksAll where p.BR <= selectedTankBR + step && p.BR >= selectedTankBR - step && p.NationId != selectedNation orderby p.ReloadTime ascending select p; tankspotential = tankvar.ToList <Tank>(); AdapterListView = new ListViewInfoTankAdapter(this, tankspotential); _InfoListView.Adapter = AdapterListView; } if (SelectedPotentialTask == 6) { List <Tank> tanksAll = TankCollection.GetTank(); double step = 1.0; var tankvar = from p in tanksAll where p.BR <= selectedTankBR + step && p.BR >= selectedTankBR - step && p.NationId != selectedNation orderby p.ReducedArmorFrontTurret descending select p; tankspotential = tankvar.ToList <Tank>(); AdapterListView = new ListViewInfoTankAdapter(this, tankspotential); _InfoListView.Adapter = AdapterListView; } if (SelectedPotentialTask == 7) { List <Tank> tanksAll = TankCollection.GetTank(); double step = 1.0; var tankvar = from p in tanksAll where p.BR <= selectedTankBR + step && p.BR >= selectedTankBR - step && p.NationId != selectedNation orderby p.ReducedArmorTopSheet descending select p; tankspotential = tankvar.ToList <Tank>(); AdapterListView = new ListViewInfoTankAdapter(this, tankspotential); _InfoListView.Adapter = AdapterListView; } }