Class: ChessVwong::Player
- Inherits:
-
Object
- Object
- ChessVwong::Player
- Defined in:
- lib/chess_vwong/player.rb
Instance Attribute Summary collapse
-
#chosen_piece ⇒ Object
Returns the value of attribute chosen_piece.
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#kill_list ⇒ Object
Returns the value of attribute kill_list.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, color = 'w') ⇒ Player
constructor
A new instance of Player.
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_piece ⇒ Object
Returns the value of attribute chosen_piece.
4 5 6 |
# File 'lib/chess_vwong/player.rb', line 4 def chosen_piece @chosen_piece end |
#color ⇒ Object (readonly)
Returns the value of attribute color.
3 4 5 |
# File 'lib/chess_vwong/player.rb', line 3 def color @color end |
#kill_list ⇒ Object
Returns the value of attribute kill_list.
4 5 6 |
# File 'lib/chess_vwong/player.rb', line 4 def kill_list @kill_list end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/chess_vwong/player.rb', line 3 def name @name end |