Class: PFM::Storage
Overview
Player PC storage
The main object is stored in $storage and PFM.game_state.storage
Defined Under Namespace
Constant Summary collapse
- MAX_BOXES =
Maximum amount of box
15
- MAX_BATTLE_BOX =
Maximum amount of battle box
16
- BOX_SIZE =
Size of a box
30
- NB_THEMES =
Number of box theme (background : Graphics/PC/f_id, title : Graphics/PC/title_id
16
- HEAL_AND_CURE_POKEMON =
Tell if the Pokemon gets healed & cured when stored
true
Instance Attribute Summary collapse
-
#battle_boxes ⇒ Array<BattleBox>
Get the battle boxes.
-
#current_battle_box ⇒ Integer
The id of the current battle box.
-
#current_box ⇒ Integer
The id of the current box.
-
#game_state ⇒ PFM::GameState
Get the game state responsive of the whole game state.
-
#lets_go_follower ⇒ PFM::Pokemon
The Let’s Go Follower.
-
#other_party ⇒ Array<PFM::Pokemon>
The party of the other actor (friend).
Class Method Summary collapse
-
.box_size ⇒ Integer
Get the box size.
Instance Method Summary collapse
-
#add_box(name)
Add a new box.
-
#any_pokemon? {|pokemon| ... } ⇒ Boolean
Yield a block on each Pokemon of storage and check if any answers to the block.
-
#any_pokemon_alive? ⇒ Boolean
(also: #any_pokemon_alive)
Check if there’s a Pokemon alive in the box (egg or not).
-
#auto_convert
Auto convert the data to the new format.
-
#box_count ⇒ Integer
(also: #max_box)
Return the amount of box in the storage.
-
#box_name_init(index)
Get the name of a box (initialize).
-
#count_pokemon(include_dead = true) ⇒ Integer
Count the number of Pokemon available in the box.
-
#current_box_object ⇒ PFM::Storage::Box
Get the current box object.
-
#delete_box(index)
Delete a box.
-
#each_pokemon {|pokemon| ... }
Yield a block on each Pokemon of storage.
-
#get_box_content(index) ⇒ Array<PFM::Pokemon, nil>
(also: #get_box)
Retrieve a box content.
-
#get_box_name(index) ⇒ String
Return a box name.
-
#get_box_theme(index) ⇒ Integer
Get a box theme.
-
#info(index) ⇒ PFM::Pokemon?
Return the Pokemon at an index in the current box.
-
#initialize(game_state) ⇒ Storage
constructor
Create a new storage.
-
#remove_pokemon_at(index) ⇒ PFM::Pokemon?
(also: #remove)
Remove a Pokemon in the current box and return what whas removed at the index.
-
#set_box_name(index, name)
Change the name of a box.
-
#set_box_theme(index, theme)
Change the theme of a box.
-
#slot_contain_pokemon?(index) ⇒ Boolean
Is the slot “index” containing a Pokemon ?.
-
#store(pokemon) ⇒ Boolean
Store a pokemon to the PC.
-
#store_pokemon_at(pokemon, index)
Store a Pokemon at a specific index in the current box.
Constructor Details
#initialize(game_state) ⇒ Storage
Create a new storage
37 38 |
# File 'docs/4_Systems_200_Storage.rb', line 37 def initialize(game_state) end |
Instance Attribute Details
#battle_boxes ⇒ Array<BattleBox>
Get the battle boxes
34 35 36 |
# File 'docs/4_Systems_200_Storage.rb', line 34 def battle_boxes @battle_boxes end |
#current_battle_box ⇒ Integer
The id of the current battle box
25 26 27 |
# File 'docs/4_Systems_200_Storage.rb', line 25 def current_battle_box @current_battle_box end |
#current_box ⇒ Integer
The id of the current box
22 23 24 |
# File 'docs/4_Systems_200_Storage.rb', line 22 def current_box @current_box end |
#game_state ⇒ PFM::GameState
Get the game state responsive of the whole game state
31 32 33 |
# File 'docs/4_Systems_200_Storage.rb', line 31 def game_state @game_state end |
#lets_go_follower ⇒ PFM::Pokemon
The Let’s Go Follower
28 29 30 |
# File 'docs/4_Systems_200_Storage.rb', line 28 def lets_go_follower @lets_go_follower end |
#other_party ⇒ Array<PFM::Pokemon>
The party of the other actor (friend)
19 20 21 |
# File 'docs/4_Systems_200_Storage.rb', line 19 def other_party @other_party end |
Class Method Details
.box_size ⇒ Integer
Get the box size
155 156 |
# File 'docs/4_Systems_200_Storage.rb', line 155 def box_size end |
Instance Method Details
#add_box(name)
Add a new box
134 135 |
# File 'docs/4_Systems_200_Storage.rb', line 134 def add_box(name) end |
#any_pokemon? {|pokemon| ... } ⇒ Boolean
Yield a block on each Pokemon of storage and check if any answers to the block
126 127 |
# File 'docs/4_Systems_200_Storage.rb', line 126 def any_pokemon? end |
#any_pokemon_alive? ⇒ Boolean Also known as: any_pokemon_alive
Check if there’s a Pokemon alive in the box (egg or not)
111 112 |
# File 'docs/4_Systems_200_Storage.rb', line 111 def any_pokemon_alive? end |
#auto_convert
Auto convert the data to the new format
40 41 |
# File 'docs/4_Systems_200_Storage.rb', line 40 def auto_convert end |
#box_count ⇒ Integer Also known as: max_box
Return the amount of box in the storage
106 107 |
# File 'docs/4_Systems_200_Storage.rb', line 106 def box_count end |
#box_name_init(index)
Get the name of a box (initialize)
70 71 |
# File 'docs/4_Systems_200_Storage.rb', line 70 def box_name_init(index) end |
#count_pokemon(include_dead = true) ⇒ Integer
Count the number of Pokemon available in the box
117 118 |
# File 'docs/4_Systems_200_Storage.rb', line 117 def count_pokemon(include_dead = true) end |
#current_box_object ⇒ PFM::Storage::Box
Any modification will be ignored
Get the current box object
50 51 |
# File 'docs/4_Systems_200_Storage.rb', line 50 def current_box_object end |
#delete_box(index)
Delete a box
130 131 |
# File 'docs/4_Systems_200_Storage.rb', line 130 def delete_box(index) end |
#each_pokemon {|pokemon| ... }
Yield a block on each Pokemon of storage
121 122 |
# File 'docs/4_Systems_200_Storage.rb', line 121 def each_pokemon end |
#get_box_content(index) ⇒ Array<PFM::Pokemon, nil> Also known as: get_box
Retrieve a box content
55 56 |
# File 'docs/4_Systems_200_Storage.rb', line 55 def get_box_content(index) end |
#get_box_name(index) ⇒ String
Return a box name
61 62 |
# File 'docs/4_Systems_200_Storage.rb', line 61 def get_box_name(index) end |
#get_box_theme(index) ⇒ Integer
Get a box theme
75 76 |
# File 'docs/4_Systems_200_Storage.rb', line 75 def get_box_theme(index) end |
#info(index) ⇒ PFM::Pokemon?
Return the Pokemon at an index in the current box
96 97 |
# File 'docs/4_Systems_200_Storage.rb', line 96 def info(index) end |
#remove_pokemon_at(index) ⇒ PFM::Pokemon? Also known as: remove
Remove a Pokemon in the current box and return what whas removed at the index
85 86 |
# File 'docs/4_Systems_200_Storage.rb', line 85 def remove_pokemon_at(index) end |
#set_box_name(index, name)
Change the name of a box
66 67 |
# File 'docs/4_Systems_200_Storage.rb', line 66 def set_box_name(index, name) end |
#set_box_theme(index, theme)
Change the theme of a box
80 81 |
# File 'docs/4_Systems_200_Storage.rb', line 80 def set_box_theme(index, theme) end |
#slot_contain_pokemon?(index) ⇒ Boolean
Is the slot “index” containing a Pokemon ?
91 92 |
# File 'docs/4_Systems_200_Storage.rb', line 91 def slot_contain_pokemon?(index) end |
#store(pokemon) ⇒ Boolean
Store a pokemon to the PC
45 46 |
# File 'docs/4_Systems_200_Storage.rb', line 45 def store(pokemon) end |
#store_pokemon_at(pokemon, index)
The pokemon is healed when stored
Store a Pokemon at a specific index in the current box
102 103 |
# File 'docs/4_Systems_200_Storage.rb', line 102 def store_pokemon_at(pokemon, index) end |