Class: ChessVwong::Player

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, color = 'w') ⇒ Player

Returns a new instance of Player.



5
6
7
8
9
10
# File 'lib/chess_vwong/player.rb', line 5

def initialize(name, color = 'w')
  @name = name
  @color = color
  @kill_list = []
  @chosen_piece = []
end

Instance Attribute Details

#chosen_pieceObject

Returns the value of attribute chosen_piece.



4
5
6
# File 'lib/chess_vwong/player.rb', line 4

def chosen_piece
  @chosen_piece
end

#colorObject (readonly)

Returns the value of attribute color.



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

def color
  @color
end

#kill_listObject

Returns the value of attribute kill_list.



4
5
6
# File 'lib/chess_vwong/player.rb', line 4

def kill_list
  @kill_list
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end