Class: Gameworks::Game::Snapshot
- Inherits:
-
Object
- Object
- Gameworks::Game::Snapshot
- Defined in:
- lib/gameworks/game_snapshot.rb
Instance Attribute Summary collapse
-
#player_scores ⇒ Object
readonly
Returns the value of attribute player_scores.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(game) ⇒ Snapshot
constructor
A new instance of Snapshot.
Constructor Details
#initialize(game) ⇒ Snapshot
Returns a new instance of Snapshot.
6 7 8 9 10 |
# File 'lib/gameworks/game_snapshot.rb', line 6 def initialize(game) @player_scores = {} game.players.each{ |p| @player_scores[p] = p.score } @state = game.state end |
Instance Attribute Details
#player_scores ⇒ Object (readonly)
Returns the value of attribute player_scores.
4 5 6 |
# File 'lib/gameworks/game_snapshot.rb', line 4 def player_scores @player_scores end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
4 5 6 |
# File 'lib/gameworks/game_snapshot.rb', line 4 def state @state end |