Class: BlackKing

Inherits:
BlackPiece show all
Includes:
King
Defined in:
lib/king.rb

Instance Attribute Summary collapse

Attributes inherited from EmptySpace

#color

Instance Method Summary collapse

Methods included from King

#castle, #checked?, #illegal

Methods included from Moves

#diagonal, #horizontal, #move, #vertical

Methods inherited from BlackPiece

#enemy_of?, #friend_of?

Methods inherited from EmptySpace

#empty?, #enemy_of?, #friend_of?, #place_on, #remove_from, #to_coord

Constructor Details

#initialize(x, y) ⇒ BlackKing

Returns a new instance of BlackKing.



97
98
99
100
101
# File 'lib/king.rb', line 97

def initialize(x,y)
  super
  @start = true
  @direction = -1
end

Instance Attribute Details

#startObject (readonly)

Returns the value of attribute start.



96
97
98
# File 'lib/king.rb', line 96

def start
  @start
end

Instance Method Details

#to_sObject



103
104
105
# File 'lib/king.rb', line 103

def to_s
  "B!"
end