Class: Battle::Actions::Switch

Inherits:
Base show all
Defined in:
docs/5_Battle_05_Actions.rb

Overview

Class describing the usage of switching out a Pokemon

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#valid?

Constructor Details

#initialize(scene, who, with) ⇒ Switch

Create a new switch action

Parameters:



157
158
# File 'docs/5_Battle_05_Actions.rb', line 157

def initialize(scene, who, with)
end

Instance Attribute Details

#who ⇒ PFM::PokemonBattler (readonly)

Get the Pokemon who's being switched

Returns:



149
150
151
# File 'docs/5_Battle_05_Actions.rb', line 149

def who
  @who
end

#with ⇒ PFM::PokemonBattler (readonly)

Get the Pokemon with the Pokemon is being switched

Returns:



152
153
154
# File 'docs/5_Battle_05_Actions.rb', line 152

def with
  @with
end

Instance Method Details

#<=>(other) ⇒ Integer

Compare this action with another

Parameters:

  • other (Base) —

    other action

Returns:

  • (Integer)


162
163
# File 'docs/5_Battle_05_Actions.rb', line 162

def <=>(other)
end

#execute

Execute the action



165
166
# File 'docs/5_Battle_05_Actions.rb', line 165

def execute
end