class Oakdex::Pokemon::GrowthEvents::ForgotAndLearnedMove

When move was learnt and other move was forgotten

Public Instance Methods

execute() click to toggle source
# File lib/oakdex/pokemon/growth_events/forgot_and_learned_move.rb, line 11
def execute
  if available_evolution
    @pokemon.add_growth_event(GrowthEvents::Evolution,
                              evolution: available_evolution,
                              after: self)
  end
  remove_event
end
message() click to toggle source
# File lib/oakdex/pokemon/growth_events/forgot_and_learned_move.rb, line 7
def message
  "#{@pokemon.name} learned #{@options[:move_id]} and forgot #{@options[:forgot_move_id]}."
end

Private Instance Methods

available_evolution() click to toggle source
# File lib/oakdex/pokemon/growth_events/forgot_and_learned_move.rb, line 22
def available_evolution
  @available_evolution ||= Oakdex::Pokemon::EvolutionMatcher
    .new(@pokemon, 'move_learned', move_id: @options[:move_id]).evolution
end