public List <String> getPokemonByElem(ETypeElement elem) { var query = from pokemonElem in Manager.getPokemonByElement(elem) select pokemonElem.Nom; return(query.ToList()); }
public Dresseur() { Nom = "SANS NOM"; ID_Pokemon = -1; Nom_Pokemon = "NO_POKEMON"; Element_Pokemon = ETypeElement.Incolore; }
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; }
public Stade(String nom, int nbPlace, ETypeElement elem, Caracteristique caract) { Nom = nom; NbPlace = nbPlace; Element = elem; _caract = caract; }
public Dresseur(String nom, Pokemon pokemon) { Nom = nom; ID_Pokemon = pokemon.ID; Nom_Pokemon = pokemon.Nom; Element_Pokemon = pokemon.Element; }
public IList <Pokemon> getPokemonByElement(ETypeElement elem) { var query = from pokemon in LsPokemon where pokemon.TypeElement == elem select pokemon; return(query.ToList()); }
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); }
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); }
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; } }
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); }
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); } }
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; }
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; }
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; }
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; }
public void ModifierStade(Stade stade, string nom, int nbPlaces, ETypeElement element) { stade.Nom = nom; stade.NbPlaces = nbPlaces; stade.Element = element; }
public Stade(int nbPlace, string nom, ETypeElement element) : base(nom) { Element = element; NbPlaces = nbPlace; }
public Pokemon(string nom, Caracteristiques carac, ETypeElement type) : base(nom) { Caracteristiques = carac; Type = type; }
public List <string> DisplayAllPokemonsByType(ETypeElement type) { return(dalManagerStub.GetAllPokemonsByType(type).Select(p => p.ToString()).ToList()); }
public List <Pokemon> GetAllPokemonsByType(ETypeElement type) { //return dalManagerStub.GetAllPokemonsByType(type); return(dalManager.GetAllPokemonsByType(type)); }
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()); }
public Pokemon(String pNom, ETypeElement pElem) { Nom = pNom; TypeElement = pElem; carac = new Caracteristiques(50, 20, 20, 20, 20); }
public Pokemon(String nom, ETypeElement elem, Caracteristique caract) { Nom = nom; Element = elem; Caract = caract; }
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]); }
public List <Pokemon> GetAllPokemonsByType(ETypeElement type) { return(GetAllPokemons().FindAll(p => p.Type == type)); }