Class: TTT::GameStateChanger
- Inherits:
-
Object
- Object
- TTT::GameStateChanger
- Defined in:
- lib/games/tictactoe/game_state_changer.rb
Instance Attribute Summary collapse
-
#game ⇒ Object
Returns the value of attribute game.
Instance Method Summary collapse
Instance Attribute Details
#game ⇒ Object
Returns the value of attribute game.
3 4 5 |
# File 'lib/games/tictactoe/game_state_changer.rb', line 3 def game @game end |
Instance Method Details
#change_game_state(player_choice, game) ⇒ Object
5 6 7 8 |
# File 'lib/games/tictactoe/game_state_changer.rb', line 5 def change_game_state(player_choice, game) @game = game change_square(player_choice) end |
#change_square(display_value) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/games/tictactoe/game_state_changer.rb', line 10 def change_square(display_value) game.change_square(display_value, game.current_player_value) if !game.won? game.move_forward_one_turn end end |