Class: HumanPlayer

Inherits:
Object
  • Object
show all
Defined in:
lib/human_player_cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(marker, ui) ⇒ HumanPlayer

Returns a new instance of HumanPlayer.



5
6
7
8
# File 'lib/human_player_cli.rb', line 5

def initialize(marker, ui)
  @marker = marker
  @ui = ui
end

Instance Attribute Details

#markerObject (readonly)

Returns the value of attribute marker.



3
4
5
# File 'lib/human_player_cli.rb', line 3

def marker
  @marker
end

Instance Method Details

#choose_space(board) ⇒ Object



10
11
12
# File 'lib/human_player_cli.rb', line 10

def choose_space(board)
  @ui.place_marker(board.check_available_spaces)
end