Class: PFM::Shop
Overview
Class describing the shop logic
Instance Attribute Summary collapse
-
#game_state ⇒ PFM::GameState
Get the game state responsive of the whole game state.
-
#pokemon_shop_list ⇒ Hash{Symbol => Array}
Hash containing the defined Pokemon shops.
-
#shop_list ⇒ Hash{Symbol => Hash{Symbol => Integer}}
Hash containing the defined shops.
Instance Method Summary collapse
-
#create_new_limited_shop(symbol_of_shop, items_sym = [], items_quantity = [], shop_rewrite: false)
Create a new limited Shop.
-
#create_new_pokemon_shop(sym_new_shop, list_id, list_price, list_param, list_quantity = [], shop_rewrite: false)
Create a new Pokemon Shop.
-
#initialize(game_state = PFM.game_state) ⇒ Shop
constructor
Create a new shop handler.
-
#migrate_ids_to_symbols
Ensure every ids stocked for every available shop is converted to a db_symbol.
-
#refill_limited_shop(symbol_of_shop, items_to_refill = [], quantities_to_refill = [])
Refill an already existing shop with items (Create the shop if it does not exist).
-
#refill_pokemon_shop(symbol_of_shop, list_id, list_price = [], list_param = [], list_quantity = [], pkm_rewrite: false)
Refill an already existing Pokemon Shop (create it if it does not exist).
-
#register_new_pokemon_in_shop(sym_shop, id, price, param, quantity, rewrite: false)
Register the Pokemon into the Array under certain conditions.
-
#remove_from_limited_shop(symbol_of_shop, items_to_remove, quantities_to_remove)
Remove items from an already existing shop (return if do not exist).
-
#remove_from_pokemon_shop(symbol_of_shop, remove_list_mon, param_form = [], quantities_to_remove = [])
Remove Pokemon from an already existing shop (return if do not exist).
-
#sort_pokemon_shop(symbol_of_shop)
Sort the Pokemon Shop list.
Constructor Details
#initialize(game_state = PFM.game_state) ⇒ Shop
Create a new shop handler
15 16 |
# File 'docs/4_Systems_203_Shop.rb', line 15 def initialize(game_state = PFM.game_state) end |
Instance Attribute Details
#game_state ⇒ PFM::GameState
Get the game state responsive of the whole game state
12 13 14 |
# File 'docs/4_Systems_203_Shop.rb', line 12 def game_state @game_state end |
#pokemon_shop_list ⇒ Hash{Symbol => Array}
Hash containing the defined Pokemon shops
9 10 11 |
# File 'docs/4_Systems_203_Shop.rb', line 9 def pokemon_shop_list @pokemon_shop_list end |
#shop_list ⇒ Hash{Symbol => Hash{Symbol => Integer}}
Hash containing the defined shops
6 7 8 |
# File 'docs/4_Systems_203_Shop.rb', line 6 def shop_list @shop_list end |
Instance Method Details
#create_new_limited_shop(symbol_of_shop, items_sym = [], items_quantity = [], shop_rewrite: false)
Create a new limited Shop
22 23 |
# File 'docs/4_Systems_203_Shop.rb', line 22 def create_new_limited_shop(symbol_of_shop, items_sym = [], items_quantity = [], shop_rewrite: false) end |
#create_new_pokemon_shop(sym_new_shop, list_id, list_price, list_param, list_quantity = [], shop_rewrite: false)
Create a new Pokemon Shop
43 44 |
# File 'docs/4_Systems_203_Shop.rb', line 43 def create_new_pokemon_shop(sym_new_shop, list_id, list_price, list_param, list_quantity = [], shop_rewrite: false) end |
#migrate_ids_to_symbols
Ensure every ids stocked for every available shop is converted to a db_symbol
75 76 |
# File 'docs/4_Systems_203_Shop.rb', line 75 def migrate_ids_to_symbols end |
#refill_limited_shop(symbol_of_shop, items_to_refill = [], quantities_to_refill = [])
Refill an already existing shop with items (Create the shop if it does not exist)
28 29 |
# File 'docs/4_Systems_203_Shop.rb', line 28 def refill_limited_shop(symbol_of_shop, items_to_refill = [], quantities_to_refill = []) end |
#refill_pokemon_shop(symbol_of_shop, list_id, list_price = [], list_param = [], list_quantity = [], pkm_rewrite: false)
Refill an already existing Pokemon Shop (create it if it does not exist)
52 53 |
# File 'docs/4_Systems_203_Shop.rb', line 52 def refill_pokemon_shop(symbol_of_shop, list_id, list_price = [], list_param = [], list_quantity = [], pkm_rewrite: false) end |
#register_new_pokemon_in_shop(sym_shop, id, price, param, quantity, rewrite: false)
Register the Pokemon into the Array under certain conditions
68 69 |
# File 'docs/4_Systems_203_Shop.rb', line 68 def register_new_pokemon_in_shop(sym_shop, id, price, param, quantity, rewrite: false) end |
#remove_from_limited_shop(symbol_of_shop, items_to_remove, quantities_to_remove)
Remove items from an already existing shop (return if do not exist)
34 35 |
# File 'docs/4_Systems_203_Shop.rb', line 34 def remove_from_limited_shop(symbol_of_shop, items_to_remove, quantities_to_remove) end |
#remove_from_pokemon_shop(symbol_of_shop, remove_list_mon, param_form = [], quantities_to_remove = [])
Remove Pokemon from an already existing shop (return if do not exist)
59 60 |
# File 'docs/4_Systems_203_Shop.rb', line 59 def remove_from_pokemon_shop(symbol_of_shop, remove_list_mon, param_form = [], quantities_to_remove = []) end |
#sort_pokemon_shop(symbol_of_shop)
Sort the Pokemon Shop list
72 73 |
# File 'docs/4_Systems_203_Shop.rb', line 72 def sort_pokemon_shop(symbol_of_shop) end |