Class: Battle::Actions::Item

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

Overview

Class describing the usage of an Item

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#valid?

Constructor Details

#initialize(scene, item_wrapper, bag, user) ⇒ Item

Create a new item action

Parameters:



134
135
# File 'docs/5_Battle_05_Actions.rb', line 134

def initialize(scene, item_wrapper, bag, user)
end

Instance Attribute Details

#item_wrapper ⇒ PFM::ItemDescriptor::Wrapper (readonly)

Get the item wrapper executing the action



128
129
130
# File 'docs/5_Battle_05_Actions.rb', line 128

def item_wrapper
  @item_wrapper
end

#user ⇒ PFM::PokemonBattler (readonly)

Get the Pokemon responsive of the item usage

Returns:



125
126
127
# File 'docs/5_Battle_05_Actions.rb', line 125

def user
  @user
end

Instance Method Details

#<=>(other) ⇒ Integer

Compare this action with another

Parameters:

  • other (Base) —

    other action

Returns:

  • (Integer)


139
140
# File 'docs/5_Battle_05_Actions.rb', line 139

def <=>(other)
end

#execute

Execute the action



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

def execute
end