stdin property

set stdin (String line)

The standard input sink.

Implementation

set stdin(String line) {
  final stateValue = _state.value;
  if (stateValue != StockfishState.ready) {
    throw StateError('Stockfish is not ready ($stateValue)');
  }

  final unicodePointer = '$line\n'.toNativeUtf8();
  final pointer = unicodePointer.cast<Char>();
  _bindings.stockfish_stdin_write(pointer);
  calloc.free(unicodePointer);
}