Class: PFM::Hall_of_Fame
- Defined in:
- scripts/01450 Systems/00300 Hall of fame/00001 PFM/02000 Hall_of_Fame.rb
Overview
Class describing the Hall_of_Fame logic
Instance Attribute Summary collapse
-
#game_state ⇒ PFM::GameState
Get the game state responsive of the whole game state.
-
#player_victory ⇒ Array
Array containing every victory of the player.
Instance Method Summary collapse
-
#initialize(game_state = PFM.game_state) ⇒ Hall_of_Fame
constructor
Create a new hall of fame.
-
#register_victory(mode = :league)
Register a win in the Pokemon League for the player.
Constructor Details
#initialize(game_state = PFM.game_state) ⇒ Hall_of_Fame
Create a new hall of fame
13 14 15 16 |
# File 'scripts/01450 Systems/00300 Hall of fame/00001 PFM/02000 Hall_of_Fame.rb', line 13 def initialize(game_state = PFM.game_state) @player_victory = [] @game_state = game_state end |
Instance Attribute Details
#game_state ⇒ PFM::GameState
Get the game state responsive of the whole game state
9 10 11 |
# File 'scripts/01450 Systems/00300 Hall of fame/00001 PFM/02000 Hall_of_Fame.rb', line 9 def game_state @game_state end |
#player_victory ⇒ Array
Array containing every victory of the player
6 7 8 |
# File 'scripts/01450 Systems/00300 Hall of fame/00001 PFM/02000 Hall_of_Fame.rb', line 6 def player_victory @player_victory end |
Instance Method Details
#register_victory(mode = :league)
Register a win in the Pokemon League for the player
20 21 22 23 24 25 26 27 28 29 30 |
# File 'scripts/01450 Systems/00300 Hall of fame/00001 PFM/02000 Hall_of_Fame.rb', line 20 def register_victory(mode = :league) pokemon_array = [] @game_state.actors.each { |pkm| pokemon_array << pkm.clone } victory = { mode: mode, team: pokemon_array, play_time: PFM.game_state.trainer.play_time_text, entry_date: Time.new } @player_victory << victory end |