Class: PoorPokemon::Player
Instance Attribute Summary
Attributes inherited from BasePlayer
#currentPokemon, #roster
Instance Method Summary
collapse
Methods inherited from BasePlayer
#allDead?, #changeCurrent
Constructor Details
#initialize ⇒ Player
Returns a new instance of Player.
2
3
4
|
# File 'lib/poor-pokemon/player.rb', line 2
def initialize
@roster = []
end
|
Instance Method Details
#add(pokemon) ⇒ Object
6
7
8
|
# File 'lib/poor-pokemon/player.rb', line 6
def add(pokemon)
@roster.push(pokemon)
end
|
#valids ⇒ Object
10
11
12
13
|
# File 'lib/poor-pokemon/player.rb', line 10
def valids
@roster.select{|pokemon|pokemon.alive?}
end
|