Class: SteppingPiece

Inherits:
Piece
  • Object
show all
Defined in:
lib/ari_chess/pieces/super/stepping_piece.rb

Direct Known Subclasses

King, Knight

Instance Attribute Summary

Attributes inherited from Piece

#board, #color, #pos

Instance Method Summary collapse

Methods inherited from Piece

#deltas, #dup, #initialize, #move_into_check?, #moves, #next_pos, #update_piece, #valid_moves, #valid_pos?

Constructor Details

This class inherits a constructor from Piece

Instance Method Details

#potential_moves(delta) ⇒ Object



2
3
4
5
6
7
# File 'lib/ari_chess/pieces/super/stepping_piece.rb', line 2

def potential_moves(delta)
  move = next_pos(pos, delta)
  return [move] if valid_pos?(move)

  []
end