Advertisement
Guest User

Untitled

a guest
Jun 10th, 2019
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. package Advanced.DefiningClasses.PokemonTrainer;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.  
  6. public class Trainer {
  7.     private int numOfBadges;
  8.     private List<Pokemon> pokemons;
  9.  
  10.     public Trainer() {
  11.         this.numOfBadges = 0;
  12.         this.pokemons = new ArrayList<>();
  13.     }
  14.  
  15.     public void addPokemon(Pokemon pokemon) {
  16.         this.pokemons.add(pokemon);
  17.     }
  18.  
  19.     public void setNumOfBadges() {
  20.         this.numOfBadges++;
  21.     }
  22.  
  23.     public List<Pokemon> getPokemons() {
  24.         return pokemons;
  25.     }
  26.  
  27.     public int getNumOfBadges() {
  28.         return numOfBadges;
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement