defuncart / shogi

A simple shogi engine for Dart and Flutter. This engine can be combined with flutter_shogi_board to render static game board positions, tsume problems or shogi castles.
MIT License
5 stars 0 forks source link

feature/add-drops-captures #4

Closed defuncart closed 4 years ago

defuncart commented 4 years ago

This PR adds the ability to have moves which don't simple move a piece from positions AB to CD, but also that a piece in hand can be dropped on the other, and that a move can capture an opponents piece.

All moves are now described using {Player}{PieceType}{CurrentPosition}{Movement}{TargetPosition}{Promotion}, i.e. ☗P77-76 , ☗P75x74, ☗S*34, ☗S34x33+ etc.

Also added extensions methods for PieceType and PlayerType, thus sdk has been raised to >= 2.6. These are far more convenient and readable than helper methods.

Added equality comparison (==) for BoardPiece and Move.

Added factory constructor fromString on Position.