class Bchess::King

Constants

KINGS_REACH

Attributes

moved[R]

Public Instance Methods

can_move_to_field?(dcolumn, drow) click to toggle source
Calls superclass method
# File lib/bchess/king.rb, line 21
def can_move_to_field?(dcolumn, drow)
  super &&
    (
      by_line(dcolumn, drow, KINGS_REACH) ||
      by_diagonal(dcolumn, drow, KINGS_REACH)
    )
end
initiialize(*args) click to toggle source
Calls superclass method
# File lib/bchess/king.rb, line 7
def initiialize(*args)
  super(args)
  @moved = false
end
move(dcolumn, drow) click to toggle source
Calls superclass method
# File lib/bchess/king.rb, line 16
def move(dcolumn, drow)
  super(dcolumn, drow)
  @moved = true
end
name() click to toggle source
# File lib/bchess/king.rb, line 12
def name
  'K'
end