1 require 'interaction/match'
3 # This class represents a local player
10 def initialize(color, board, notify)
17 @board.flip!(color != :white)
18 @board.warp(match.state)
19 @board.movable = lambda do |state, p|
20 state.board[p].color == color
24 @board.observe :new_move do |data|
25 match.move(user, data[:move], data[:state])
28 @notify[:newGame => 'Starting new game']
32 @board.forward(data[:state], data[:move])
33 @notify[:move => "A new move has been played"]