Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- programme main:
- TabPokemon tab = new TabPokemon();
- PokemonSportif poke = new PokemonSportif("Pikachu", 110, 22, 1, 56);
- tab.Add(poke);
- PokemonSportif poke1 = new PokemonSportif("Aikachu2", 15, 2, 3, 56);
- tab.Add(poke1);
- PokemonSportif poke2 = new PokemonSportif("Dikachu3", 5, 8, 2, 56);
- tab.Add(poke2);
- PokemonSportif poke3 = new PokemonSportif("Bikachu4", 10, 30, 1, 56);
- tab.Add(poke3);
- tab.trierParPlusGros();
- foreach(Pokemon p in tab)
- {
- write(p.ToString());
- sauterLigne();
- write(p.Poid.ToString());
- }
- Console.Read();
- classe TabPokemon:
- class TabPokemon : List<Pokemon>
- {
- List<Pokemon> PokeList;
- public TabPokemon()
- {
- PokeList = new List<Pokemon>();
- }
- public void trierParPlusGros()
- {
- var sorted = from p in PokeList orderby p.Poid ascending select p;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement