class Player

Attributes

color[RW]
moves[RW]
name[RW]
symbol[RW]

Public Class Methods

new() click to toggle source

we’re going to be passing @moves to the board object to check for a winner, so it should be able to read the moves.

# File lib/connect_four.rb, line 261
def initialize
        @symbol = nil
        @name = nil
        @moves = []
end

Public Instance Methods

add_move(cell) click to toggle source
# File lib/connect_four.rb, line 267
def add_move(cell) #adds a cell object to player's moves array
        @moves << cell
end