Class: JustXiangqi::Zu
- Defined in:
- lib/just_xiangqi/pieces/zu.rb
Overview
Zu
The piece that can move one space forward and can also move one space horizontally when on the opposite side of the river.
Instance Method Summary collapse
-
#destinations(square, game_state) ⇒ SquareSet
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) ⇒ SquareSet
All the squares that the piece can move to and/or capture.
17 18 19 |
# File 'lib/just_xiangqi/pieces/zu.rb', line 17 def destinations(square, game_state) same_file_forwards_and_or_same_rank(square, game_state).in_range(square, 1).unoccupied_or_occupied_by_opponent(player_number) end |