2024-05-16 04:27:07 +03:00
|
|
|
interface chess {
|
2024-05-14 05:43:09 +03:00
|
|
|
/// Our "chess protocol" request/response format. We'll always serialize these
|
|
|
|
/// to a byte vector and send them over IPC.
|
|
|
|
|
2024-05-16 04:27:07 +03:00
|
|
|
variant request {
|
2024-05-06 21:12:08 +03:00
|
|
|
new-game(new-game-request),
|
|
|
|
move(move-request),
|
|
|
|
resign(string),
|
|
|
|
}
|
|
|
|
|
2024-05-16 04:27:07 +03:00
|
|
|
variant response {
|
2024-05-06 21:12:08 +03:00
|
|
|
new-game-accepted,
|
|
|
|
new-game-rejected,
|
|
|
|
move-accepted,
|
|
|
|
move-rejected,
|
|
|
|
}
|
|
|
|
|
|
|
|
record new-game-request {
|
|
|
|
white: string,
|
|
|
|
black: string,
|
|
|
|
}
|
|
|
|
|
|
|
|
record move-request {
|
|
|
|
game-id: string,
|
|
|
|
move-str: string,
|
|
|
|
}
|
|
|
|
}
|
2024-05-16 04:27:07 +03:00
|
|
|
|
|
|
|
world chess-sys-v0 {
|
|
|
|
import chess;
|
2024-05-18 09:59:40 +03:00
|
|
|
include process-v0;
|
2024-05-16 04:27:07 +03:00
|
|
|
}
|