Module: GamePlay::PokemonTradeStorageMixin
- Included in:
- PokemonTradeStorage
- Defined in:
- scripts/01450 Systems/00200 Storage/00003 GamePlay_Storage/00099 TradeMixin.rb
Overview
Mixin definin the Input/Output of the PokemonTradeStorage class
Instance Attribute Summary collapse
-
#return_data ⇒ Integer?
readonly
Get the selected Pokemon index (1~30) = current box, (31~36) = party.
Instance Method Summary collapse
-
#pokemon_selected? ⇒ Boolean
Tell if a Pokemon was selected.
-
#pokemon_selected_in_box? ⇒ Boolean
Tell if the selected Pokemon is from box.
-
#pokemon_selected_in_party? ⇒ Boolean
Tell if the selected Pokemon is from party.
-
#selected_pokemon ⇒ PFM::Pokemon?
Get the selected Pokemon.
Instance Attribute Details
#return_data ⇒ Integer? (readonly)
Get the selected Pokemon index (1~30) = current box, (31~36) = party
6 7 8 |
# File 'scripts/01450 Systems/00200 Storage/00003 GamePlay_Storage/00099 TradeMixin.rb', line 6 def return_data @return_data end |
Instance Method Details
#pokemon_selected? ⇒ Boolean
Tell if a Pokemon was selected
10 11 12 13 14 |
# File 'scripts/01450 Systems/00200 Storage/00003 GamePlay_Storage/00099 TradeMixin.rb', line 10 def pokemon_selected? return false unless return_data return !selected_pokemon.nil? end |
#pokemon_selected_in_box? ⇒ Boolean
Tell if the selected Pokemon is from box
27 28 29 30 31 |
# File 'scripts/01450 Systems/00200 Storage/00003 GamePlay_Storage/00099 TradeMixin.rb', line 27 def pokemon_selected_in_box? return false unless return_data return return_data.to_i.between?(1, 30) end |
#pokemon_selected_in_party? ⇒ Boolean
Tell if the selected Pokemon is from party
35 36 37 38 39 |
# File 'scripts/01450 Systems/00200 Storage/00003 GamePlay_Storage/00099 TradeMixin.rb', line 35 def pokemon_selected_in_party? return false unless return_data return return_data.to_i.between?(31, 36) end |
#selected_pokemon ⇒ PFM::Pokemon?
Get the selected Pokemon
18 19 20 21 22 23 |
# File 'scripts/01450 Systems/00200 Storage/00003 GamePlay_Storage/00099 TradeMixin.rb', line 18 def selected_pokemon return $storage.info(return_data - 1) if pokemon_selected_in_box? return $actors[return_data - 31] if pokemon_selected_in_party? return nil end |