Class: Chess::Bishop
- Inherits:
-
BoardgameEngine::Piece
- Object
- BoardgameEngine::Piece
- Chess::Bishop
- Defined in:
- lib/boardgame_engine/chess.rb
Instance Attribute Summary
Attributes inherited from BoardgameEngine::Piece
Instance Method Summary collapse
-
#initialize(owner) ⇒ Bishop
constructor
A new instance of Bishop.
- #valid_move?(start_location, end_location, board) ⇒ Boolean
Methods inherited from BoardgameEngine::Piece
Constructor Details
#initialize(owner) ⇒ Bishop
Returns a new instance of Bishop.
182 183 184 |
# File 'lib/boardgame_engine/chess.rb', line 182 def initialize(owner) super(owner, 'B') end |
Instance Method Details
#valid_move?(start_location, end_location, board) ⇒ Boolean
186 187 188 189 190 191 |
# File 'lib/boardgame_engine/chess.rb', line 186 def valid_move?(start_location, end_location, board) row, col = start_location end_row, end_col = end_location board.clear_diag_path?(row, col, end_row, end_col, board) end |