Class: JustXiangqi::Pao
- Defined in:
- lib/just_xiangqi/pieces/pao.rb
Overview
Ju
The piece that can move orthogonally and captures by jumping over
Constant Summary collapse
- MOVEMENT_VECTORS =
[ BoardGameGrid::Point.new(0, -1), BoardGameGrid::Point.new(1, 0), BoardGameGrid::Point.new(0, 1), BoardGameGrid::Point.new(-1, 0) ]
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.
24 25 26 |
# File 'lib/just_xiangqi/pieces/pao.rb', line 24 def destinations(square, game_state) move_squares(square, game_state) + capture_squares(square, game_state) end |