Sha256: 279f38889fe83131fa56e7d1e8d9aac2afa07dd32fd3f7d0925e5acfdf5c2e66
Contents?: true
Size: 573 Bytes
Versions: 11
Compression:
Stored size: 573 Bytes
Contents
require 'just_chess/pieces/piece' module JustChess # = Bishop # # The piece that moves diagonally any number of squares class Bishop < Piece # All the squares that the piece can move to and/or capture. # # @param [Square] square # the origin square. # # @param [GameState] game_state # the current game state. # # @return [SquareSet] def destinations(square, game_state) game_state.squares.diagonal(square).unoccupied_or_occupied_by_opponent(player_number).unblocked(square, game_state.squares) end end end
Version data entries
11 entries across 11 versions & 1 rubygems