edaxGetLastMove method

Move edaxGetLastMove()

Get the last move.

NOTE: you have to handle the case that noMove is true.

Implementation

@useResult
Move edaxGetLastMove() {
  return using((Arena arena) {
    final moves = edaxGetMoves();
    if (moves.isEmpty) return const Move(0, MoveMark.noMove, 0, 0);

    final dst = arena<bindings.Move>();
    _bindings.edax_get_last_move(dst);
    final move = Move.fromCStruct(dst.ref);
    return move;
  });
}