コード例 #1
0
ファイル: FormOptions.cs プロジェクト: KakugaGoka/PokeGenesis
 private void RefreshRegions()
 {
     regionList = new List <PokeRegion>();
     regionList = regionXML.createList();
     spawnList  = new List <PokeRegion>();
     spawnList  = spawnXML.createList();
     listRegions.Items.Clear();
     for (var i = 0; i < regionList.Count; i++)
     {
         listRegions.Items.Add(regionList[i].RegionName);
     }
     listRegions.SelectedIndex = 0;
     listRegionAllowed.Items.Clear();
     listRegionBanned.Items.Clear();
     foreach (Spawn s in spawnList[listRegions.SelectedIndex].Spawns)
     {
         if (s.Name != "Placeholder")
         {
             listRegionAllowed.Items.Add(s.Name);
         }
         if (!listPokeDex.Items.Contains(s.Name))
         {
             listRegionAllowed.Items.Remove(s.Name);
         }
     }
     SortPokeList();
     foreach (Pokemon s in pokeList)
     {
         if (!listRegionAllowed.Items.Contains(s.id) && listPokeDex.Items.Contains(s.id))
         {
             listRegionBanned.Items.Add(s.id);
         }
     }
     listRegionAllowed.SelectedIndex = 0;
 }