Class: WhiteKing
- Inherits:
-
WhitePiece
- Object
- EmptySpace
- Piece
- WhitePiece
- WhiteKing
- Includes:
- King
- Defined in:
- lib/king.rb
Instance Attribute Summary collapse
-
#start ⇒ Object
readonly
Returns the value of attribute start.
Attributes inherited from EmptySpace
Instance Method Summary collapse
-
#initialize(x, y) ⇒ WhiteKing
constructor
A new instance of WhiteKing.
- #to_s ⇒ Object
Methods included from King
Methods included from Moves
#diagonal, #horizontal, #move, #vertical
Methods inherited from WhitePiece
Methods inherited from EmptySpace
#empty?, #enemy_of?, #friend_of?, #place_on, #remove_from, #to_coord
Constructor Details
#initialize(x, y) ⇒ WhiteKing
Returns a new instance of WhiteKing.
81 82 83 84 85 |
# File 'lib/king.rb', line 81 def initialize(x,y) super @start = true @direction = 1 end |
Instance Attribute Details
#start ⇒ Object (readonly)
Returns the value of attribute start.
80 81 82 |
# File 'lib/king.rb', line 80 def start @start end |
Instance Method Details
#to_s ⇒ Object
87 88 89 |
# File 'lib/king.rb', line 87 def to_s "W!" end |