class JustShogi::Fuhyou

Fuhyou

The piece that moves forward one space.

Public Instance Methods

destinations(square, game_state) click to toggle source

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]

# File lib/just_shogi/pieces/fuhyou.rb, line 19
def destinations(square, game_state)
  game_state.squares.in_range(square, 1).in_direction(square, forwards_direction).orthogonal(square).unoccupied_or_occupied_by_opponent(player_number).unblocked(square, game_state.squares)
end