Exemplo n.º 1
0
        public Pokemon Acheter(Pokemon pokemon)
        {
            Pokemon pokemonAchete = new Pokemon();
            int     prix          = pokemon.Price;

            if (Money >= prix && !pokemon.Achete)
            {
                ModifierArgent(-prix);
                pokemonAchete = (Pokemon)pokemon.Clone();
                pokemonAchete.Acheter();
                Depot.PokemonsAchetes.Add(pokemonAchete);
                Statistiques.PokemonsAchetes++;
            }

            return(pokemonAchete);
        }
        public Pokemon EvoluerSiAtteintLeNiveau(Pokemon pokemon)
        {
            if (pokemon.Evolue && pokemon.Level >= Level && !pokemon.Name.Equals(To))
            {
                Pokemon evolution = (Pokemon)Game.PokemonsDeBase
                                    .Find(p => p.Name.Equals(To))
                                    .Clone();

                evolution.Acheter();
                evolution.ATK         = pokemon.ATK;
                evolution.DEF         = pokemon.DEF;
                evolution.Emplacement = pokemon.Emplacement;
                evolution.Level       = pokemon.Level;
                evolution.XpGauge     = pokemon.XpGauge;

                return(evolution);
            }
            return(null);
        }