Class: Player

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePlayer

read the moves.



261
262
263
264
265
# File 'lib/connect_four.rb', line 261

def initialize
	@symbol = nil
	@name = nil
	@moves = []
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



257
258
259
# File 'lib/connect_four.rb', line 257

def color
  @color
end

#movesObject

Returns the value of attribute moves.



257
258
259
# File 'lib/connect_four.rb', line 257

def moves
  @moves
end

#nameObject

Returns the value of attribute name.



257
258
259
# File 'lib/connect_four.rb', line 257

def name
  @name
end

#symbolObject

Returns the value of attribute symbol.



257
258
259
# File 'lib/connect_four.rb', line 257

def symbol
  @symbol
end

Instance Method Details

#add_move(cell) ⇒ Object

adds a cell object to player’s moves array



267
268
269
# File 'lib/connect_four.rb', line 267

def add_move(cell) #adds a cell object to player's moves array
	@moves << cell
end