Ejemplo n.º 1
0
        public List <String> getPokemonByElem(ETypeElement elem)
        {
            var query = from pokemonElem in Manager.getPokemonByElement(elem)
                        select pokemonElem.Nom;

            return(query.ToList());
        }
Ejemplo n.º 2
0
 public Dresseur()
 {
     Nom             = "SANS NOM";
     ID_Pokemon      = -1;
     Nom_Pokemon     = "NO_POKEMON";
     Element_Pokemon = ETypeElement.Incolore;
 }
Ejemplo n.º 3
0
 public Pokemon(int id, String nom, ETypeElement elem, int valvie, int valforce, int valesq, int valendur, int valvit)
 {
     ID          = id;
     carac       = new Caracteristiques(valvie, valforce, valesq, valendur, valvit);
     Nom         = nom;
     TypeElement = elem;
 }
Ejemplo n.º 4
0
 public Stade(String nom, int nbPlace, ETypeElement elem, Caracteristique caract)
 {
     Nom     = nom;
     NbPlace = nbPlace;
     Element = elem;
     _caract = caract;
 }
Ejemplo n.º 5
0
 public Dresseur(String nom, Pokemon pokemon)
 {
     Nom             = nom;
     ID_Pokemon      = pokemon.ID;
     Nom_Pokemon     = pokemon.Nom;
     Element_Pokemon = pokemon.Element;
 }
Ejemplo n.º 6
0
        public IList <Pokemon> getPokemonByElement(ETypeElement elem)
        {
            var query = from pokemon in LsPokemon
                        where pokemon.TypeElement == elem
                        select pokemon;

            return(query.ToList());
        }
Ejemplo n.º 7
0
        public static Stade GenerateStade(int id, ETypeElement type)
        {
            Stade stade = new Stade(id);

            stade.Type     = type;
            stade.Attaque  = rand.Next(1, 6);
            stade.Defense  = stade.Attaque;
            stade.NbPlaces = rand.Next(50, 400);
            return(stade);
        }
Ejemplo n.º 8
0
        public List <Pokemon> GetAllPokemonsByType(ETypeElement type)
        {
            List <Pokemon> listPokemons = new List <Pokemon>();
            DataTable      dt           = Select("select * from pokemon where type=" + (int)type);

            foreach (DataRow item in dt.Rows)
            {
                listPokemons.Add(GetPokemon(item));
            }
            return(listPokemons);
        }
Ejemplo n.º 9
0
 private void BuffNerfPokemonByStade(ETypeElement type, Caracteristique carac, Stade stade)
 {
     if (type == stade.Type)
     {
         carac.Attaque += stade.Attaque;
         carac.Defense += stade.Defense;
     }
     else if (GetMultiplicatorBetweenType(type, stade.Type) == 0.5m)
     {
         carac.Attaque -= stade.Attaque;
         carac.Defense -= stade.Defense;
     }
 }
Ejemplo n.º 10
0
        private decimal GetMultiplicatorBetweenType(ETypeElement type1, ETypeElement type2)
        {
            decimal multiplicator = 1m;

            if (Pokemon.TableFaiblesses[(int)type1, (int)type2] == -1)
            {
                multiplicator = 0.5m;
            }
            else if (Pokemon.TableFaiblesses[(int)type1, (int)type2] == 1)
            {
                multiplicator = 2m;
            }
            return(multiplicator);
        }
Ejemplo n.º 11
0
 public double Typecoeff(ETypeElement elem1, ETypeElement elem2)
 {
     if (elem1 > elem2)
     {
         return(2);                 /*Console.WriteLine(elem1+" super efficace contre "+elem2);*/
     }
     else if (elem1 < elem2)
     {
         return(0.5);                      /*Console.WriteLine(elem1 + " pas tres efficace contre " + elem2);*/
     }
     else
     {
         return(1);
     }
 }
Ejemplo n.º 12
0
        public Pokemon GetPokemonById(int id)
        {
            Pokemon pokemon = null;

            string request = "select * from Pokemon where id=" + id.ToString();
            DataTable dataTable = SelectByDataAdapter(request);
            if (dataTable.Rows.Count > 0)
            {
                DataRow data = dataTable.Rows[0];
                string nom = data["Nom"].ToString();
                Caracteristiques carac = GetCaracteristiqueById(Convert.ToInt32(data["Caracteristiques"]));
                ETypeElement type = (ETypeElement)Convert.ToInt32(data["Type"]);
                pokemon = new Pokemon(nom, carac, type);
                pokemon.ID = Convert.ToInt32(data["Id"]);
            }
            return pokemon;
        }
Ejemplo n.º 13
0
        public Stade GetStadeById(int Id)
        {
            Stade stade = null;

            string request = "select * from Stade where id=" + Id.ToString();
            DataTable dataTable = SelectByDataAdapter(request);
            if (dataTable.Rows.Count > 0)
            {
                DataRow data = dataTable.Rows[0];

                int nbPlace = Convert.ToInt32(data["nbPlaces"]);
                string nom = data["Nom"].ToString();
                ETypeElement type = (ETypeElement)Convert.ToInt32(data["Element"]);
                stade = new Stade(nbPlace,nom,type);
                stade.ID = Convert.ToInt32(data["Id"]);
            }
            return stade;
        }
Ejemplo n.º 14
0
        public List<Stade> GetAllStades()
        {
            List<Stade> listStade = new List<Stade>();
            string request = "Select * from Stade;";

            DataTable dataTable = SelectByDataAdapter(request);

            foreach (DataRow item in dataTable.Rows)
            {
                string nom = item["Nom"].ToString();
                int nbPlaces = Convert.ToInt32(item["NbPlaces"]);
                ETypeElement type = (ETypeElement)Convert.ToInt32(item["Element"]);
                Stade stade = new Stade(nbPlaces, nom, type);
                stade.ID = Convert.ToInt32(item["Id"]);
                listStade.Add(stade);
            }

            return listStade;
        }
Ejemplo n.º 15
0
        public List<Pokemon> GetAllPokemons()
        {
            List<Pokemon> listPokemon = new List<Pokemon>();
            string request = "Select * from Pokemon;";

            DataTable dataTable = SelectByDataAdapter(request);

            foreach( DataRow item in dataTable.Rows)
            {
                string nom = item["Nom"].ToString();
                ETypeElement type = (ETypeElement)Convert.ToInt32(item["Type"]);
                Caracteristiques carac = GetCaracteristiqueById(Convert.ToInt32(item["Caracteristiques"]));
                Pokemon pokemon = new Pokemon(nom,carac,type);
                pokemon.ID = Convert.ToInt32(item["Id"]);
                listPokemon.Add(pokemon);
            }
            
            return listPokemon;
        }
Ejemplo n.º 16
0
 public void ModifierStade(Stade stade, string nom, int nbPlaces, ETypeElement element)
 {
     stade.Nom      = nom;
     stade.NbPlaces = nbPlaces;
     stade.Element  = element;
 }
Ejemplo n.º 17
0
 public Stade(int nbPlace, string nom, ETypeElement element) : base(nom)
 {
     Element  = element;
     NbPlaces = nbPlace;
 }
Ejemplo n.º 18
0
 public Pokemon(string nom, Caracteristiques carac, ETypeElement type) : base(nom)
 {
     Caracteristiques = carac;
     Type             = type;
 }
Ejemplo n.º 19
0
 public List <string> DisplayAllPokemonsByType(ETypeElement type)
 {
     return(dalManagerStub.GetAllPokemonsByType(type).Select(p => p.ToString()).ToList());
 }
Ejemplo n.º 20
0
 public List <Pokemon> GetAllPokemonsByType(ETypeElement type)
 {
     //return dalManagerStub.GetAllPokemonsByType(type);
     return(dalManager.GetAllPokemonsByType(type));
 }
Ejemplo n.º 21
0
 public Pokemon(string nom, ETypeElement elem) : base(nom)
 {
     Caracteristiques = new Caracteristiques(100, 20, 10, 10);
     Type             = elem;
 }
 public List <Pokemon> getPokemonByElem(ETypeElement elem)
 {
     return(Manager.ListPokemon.Where(x => x.Element == elem).ToList());
 }
Ejemplo n.º 23
0
 public Pokemon(String pNom, ETypeElement pElem)
 {
     Nom         = pNom;
     TypeElement = pElem;
     carac       = new Caracteristiques(50, 20, 20, 20, 20);
 }
Ejemplo n.º 24
0
 public Pokemon(String nom, ETypeElement elem, Caracteristique caract)
 {
     Nom     = nom;
     Element = elem;
     Caract  = caract;
 }
Ejemplo n.º 25
0
 public List <Pokemon> GetAllPokemonsByType(ETypeElement type)
 {
     return(dalDb.GetAllPokemonsByType(type));
 }
 /// <summary>
 /// Определяет материал, который должен быть у объекта
 /// Используется при инициализации объекта
 /// </summary>
 /// <param name="numberZone">Номер зоны, где находится объект</param>
 /// <param name="typeMaterial">Тип материала, который требуется инициализировать</param>
 /// <returns></returns>
 public Material GetMaterial(int numberZone, ETypeElement typeMaterial)
 {
     return(materials[(numberZone + (int)typeMaterial) % 2]);
 }
Ejemplo n.º 27
0
 public List <Pokemon> GetAllPokemonsByType(ETypeElement type)
 {
     return(GetAllPokemons().FindAll(p => p.Type == type));
 }