Class: JustXiangqi::Ju
- Defined in:
- lib/just_xiangqi/pieces/ju.rb
Overview
Ju
The piece that can move orthogonally.
Instance Method Summary collapse
-
#destinations(square, game_state) ⇒ Object
All the squares that the piece can move to and/or capture.
Methods inherited from Piece
Constructor Details
This class inherits a constructor from JustXiangqi::Piece
Instance Method Details
#destinations(square, game_state) ⇒ Object
All the squares that the piece can move to and/or capture.
15 16 17 |
# File 'lib/just_xiangqi/pieces/ju.rb', line 15 def destinations(square, game_state) game_state.squares.orthogonal(square).unoccupied_or_occupied_by_opponent(player_number).unblocked(square, game_state.squares) end |