Ejemplo n.º 1
0
        private void init()
        {
            pb_choixpokeadversaire.Hide();
            pb_votrechoixpoke.Hide();
            Description_poke_adversaire.Hide();
            Description_poke_joueur.Hide();
            b_combat.Hide();
            label_votrepoke.Hide();
            label_adversairePoke.Hide();
            label_VS.Hide();
            pokemons = GenerationPokemon.LoadPokemons();
            pokeList = new List <String>();
            int    i    = 0;
            String path = @"D:\OneDrive - Ynov\Ingesup\2ieme_annee\C_Scharp\TP1_Pokemon\TP1_Pokemon\Model\pokemon";

            try
            {
                //foreach (string fileName in Directory.GetFiles(@"C:\Users\Romain\Documents\OneDrive - Ynov\Ingesup\2ieme_annee\C_Scharp\TP1_Pokemon\TP1_Pokemon\Model\pokemon\"))
                foreach (string fileName in Directory.GetFiles(path))
                {
                    pokeList.Add(fileName);
                    Console.WriteLine(pokeList[i]);
                    i++;
                }
            } catch (DirectoryNotFoundException)
            {
                MessageBox.Show("Il semblerait que le chemin pour accéder aux images ne convient pas. Veuillez entrer le votre :  ");
                problemAccessDossierPokemon chemin = new problemAccessDossierPokemon();
                this.Hide();
                chemin.Show();
            }


            try
            {
                Image image = Image.FromFile(pokeList[position]);
                pokeBox.SizeMode   = PictureBoxSizeMode.Zoom;
                this.pokeBox.Image = image;
                fillPokeStat(position, label_pokemon_stats);
            }
            catch (ArgumentOutOfRangeException)
            {
                position = 0;
            }
        }
Ejemplo n.º 2
0
 public static Pokemon[] returnGeneratedPokemon()
 {
     return(GenerationPokemon.LoadPokemons());
 }