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:



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

def initialize(scene, who, with)
end

Instance Attribute Details

#whoPFM::PokemonBattler (readonly)

Get the Pokemon who’s being switched

Returns:



143
144
145
# File 'docs/5_Battle_05_Actions.rb', line 143

def who
  @who
end

#withPFM::PokemonBattler (readonly)

Get the Pokemon with the Pokemon is being switched

Returns:



146
147
148
# File 'docs/5_Battle_05_Actions.rb', line 146

def with
  @with
end

Instance Method Details

#<=>(other) ⇒ Integer

Compare this action with another

Parameters:

  • other (Base)

    other action

Returns:

  • (Integer)


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

def <=>(other)
end

#execute

Execute the action



159
160
# File 'docs/5_Battle_05_Actions.rb', line 159

def execute
end