edaxGetLastMove method

Move edaxGetLastMove()

Get the last move.

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

Implementation

Move edaxGetLastMove() {
  final moves = edaxGetMoves();
  if (moves.isEmpty) return const Move(0, MoveMark.noMove, 0, 0);

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