Sha256: 7497f62f192fe8fcb9e8d857b19fbb2e9657fda019b3b18ba6fd4ef7f28df8ae
Contents?: true
Size: 602 Bytes
Versions: 11
Compression:
Stored size: 602 Bytes
Contents
require 'just_chess/pieces/piece' module JustChess # = Queen # # The piece that moves any number of squares orthogonally or diagonally. class Queen < 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.orthogonal_or_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