Code/Gameplay/IChessBoardAdapter.cs

Interfaces for adapting a chess board state to the game. IChessBoardAdapter defines methods to apply local or remote UCI moves and to export/import board state. IChessInitialPositionAdapter optionally allows setting a non-starting initial FEN position.

Networking
#nullable enable annotations

namespace LichessNET.Gameplay;

public interface IChessBoardAdapter
{
    bool TryApplyLocalMove(string uci);
    bool TryApplyRemoteMove(string uci);
    string ExportState();
    void ImportState(string state);
}

/// <summary>
/// Optional adapter capability for games whose gameFull event supplies a
/// non-starting FEN.
/// </summary>
public interface IChessInitialPositionAdapter
{
    bool TrySetInitialPosition(string fen);
}