Exemplo n.º 1
0
 public void SetModel(Pokemon model)
 {
     _model = model;
     Evolutions.Clear();
     for (int i = 0; i < _model.Evolutions.Count; i++)
     {
         var newItem = new EvolutionComboBoxItem(_model.Evolutions, i, _evolutionEntryOptions);
         Evolutions.Add(newItem);
     }
     HabitatItems.Clear();
     foreach (KingdomId kingdom in EnumUtil.GetValuesExceptDefaults <KingdomId>())
     {
         HabitatItems.Add(new HabitatItem(model, kingdom, _idToNameService.IdToName <IKingdomService>((int)kingdom)));
     }
     RaiseAllPropertiesChanged();
 }
        void FilterItems(string filter)
        {
            var filteredItems = source.Where(Patient => Patient.Evolution.ToLower().Contains(filter.ToLower())).ToList();

            foreach (var Patient in source)
            {
                if (!filteredItems.Contains(Patient))
                {
                    Evolutions.Remove(Patient);
                }
                else
                {
                    if (!Evolutions.Contains(Patient))
                    {
                        Evolutions.Add(Patient);
                    }
                }
            }
        }
Exemplo n.º 3
0
        public PokemonModel(PokemonId id)
        {
            PokemonSettings pokeman = GameClient.GetExtraDataForPokemon(id);

            BuildFromSettings(pokeman);

            PokedexEntry pokedexEntry = GameClient.PokedexInventory.FirstOrDefault(x => x.PokemonId == id);

            BuildFromPokedexEntry(pokedexEntry);

            PokemonModel pokemonModel = new PokemonModel(pokeman, pokedexEntry);

            var CurrPokemon = pokemonModel;

            Evolutions.Add(pokemonModel);
            while (CurrPokemon.ParentPokemonId != PokemonId.Missingno)
            {
                var insertme = FromId(CurrPokemon.ParentPokemonId);
                Evolutions.Insert(0, insertme);
                CurrPokemon = FromId(CurrPokemon.ParentPokemonId);
            }
            CurrPokemon = pokemonModel;
            while (CurrPokemon.EvolutionIds.Count > 0)
            {
                foreach (PokemonId ev in CurrPokemon.EvolutionIds)
                {
                    var addme = FromId(ev);
                    Evolutions.Add(addme);
                }
                CurrPokemon = new PokemonModel(CurrPokemon.EvolutionIds.ElementAt(0));
            }

            if (TimesCaptured == 0 && Id == PokemonId.Poliwag)
            {
                Debug.WriteLine(Name);
            }
        }