Advertisement
Guest User

poke

a guest
Sep 27th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 KB | None | 0 0
  1. programme main:
  2.  
  3. TabPokemon tab = new TabPokemon();
  4.             PokemonSportif poke = new PokemonSportif("Pikachu", 110, 22, 1, 56);
  5.             tab.Add(poke);
  6.             PokemonSportif poke1 = new PokemonSportif("Aikachu2", 15, 2, 3, 56);
  7.             tab.Add(poke1);
  8.             PokemonSportif poke2 = new PokemonSportif("Dikachu3", 5, 8, 2, 56);
  9.             tab.Add(poke2);
  10.             PokemonSportif poke3 = new PokemonSportif("Bikachu4", 10, 30, 1, 56);
  11.             tab.Add(poke3);
  12.             tab.trierParPlusGros();
  13.            
  14.             foreach(Pokemon p in tab)
  15.             {
  16.                 write(p.ToString());
  17.                 sauterLigne();
  18.                 write(p.Poid.ToString());
  19.             }
  20.             Console.Read();
  21.  
  22.  
  23. classe TabPokemon:
  24.  
  25. class TabPokemon : List<Pokemon>
  26.     {
  27.         List<Pokemon> PokeList;
  28.  
  29.         public TabPokemon()
  30.         {
  31.             PokeList = new List<Pokemon>();
  32.         }
  33.         public void trierParPlusGros()
  34.         {
  35.             var sorted = from p in PokeList orderby p.Poid ascending select p;
  36.            
  37.         }
  38.        
  39.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement