Class: XO::Init
- Defined in:
- lib/xo/engine/init.rb
Instance Method Summary collapse
-
#start(turn) ⇒ Object
Starts a new game.
Instance Method Details
#start(turn) ⇒ Object
Starts a new game.
The engine is transitioned into the Playing state and the event
{ name: :game_started }
is triggered.
18 19 20 21 22 |
# File 'lib/xo/engine/init.rb', line 18 def start(turn) game_context.check_turn(turn) game_context.set_turn_and_clear_grid(turn) engine.transition_to_state_and_send_event(Playing, :game_started) end |