class CpuPlayer

require 'player'

Attributes

ai[RW]

Public Class Methods

new(token, ai) click to toggle source
# File lib/cpu_player.rb, line 6
def initialize(token, ai)
  @token = token
  @ai = ai  
end

Public Instance Methods

perform_move(game_state, move_param = nil) click to toggle source
# File lib/cpu_player.rb, line 11
  def perform_move(game_state, move_param = nil)
    move = @ai.calculate_move(game_state.board, self)
    
#    board.add_piece(@token, move)
    game_state.update(move)
  end