Method: Bishop#could_perform_move
- Defined in:
- lib/bangkok/piece.rb
#could_perform_move(move) ⇒ Object
124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/bangkok/piece.rb', line 124 def could_perform_move(move) return false unless super # Quick square color check square = move.square return false unless square.color == @square.color d_file = (@square.file - square.file).abs d_rank = (@square.rank - square.rank).abs return false unless d_file == d_rank # diagonal return clear_to?(square) end |