Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace _9._Pokemon_Trainer_EXE
  7. {
  8. public class Trainer
  9. {
  10. public Trainer(string name, Pokemon collectionOfPokemons)
  11. {
  12. var counter = 1;
  13. this.Name = name;
  14. this.NumberOfBadges = 0;
  15. if (counter != 1)
  16. {
  17. this.CollectionOfPokemons.Add(collectionOfPokemons);
  18. }
  19. else
  20. {
  21. this.CollectionOfPokemons = new List<Pokemon>();
  22. CollectionOfPokemons.Add(collectionOfPokemons);
  23. }
  24. this.Appierence++;
  25. }
  26. public string Name { get; set; }
  27. public int Appierence { get; private set; }
  28. public int NumberOfBadges { get; set; }
  29. public List<Pokemon> CollectionOfPokemons { get; set; }
  30. public void RemovePokemons()
  31. {
  32. CollectionOfPokemons = CollectionOfPokemons.Where(x => x.Health > 0).ToList();
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement