diff -r 808a7324b467 -r ceb9197b3c6d src/game.c --- a/src/game.c Mon Jun 02 19:32:37 2025 +0200 +++ b/src/game.c Mon Jun 02 19:40:24 2025 +0200 @@ -31,6 +31,8 @@ #include "network.h" #include "input.h" #include "colors.h" +#include "chess/rules.h" +#include "chess/pgn.h" #include #include #include @@ -569,3 +571,43 @@ game_continue(settings, opponent, &gamestate); } + +void dump_gameinfo(GameInfo *gameinfo) { + int serverwhite = gameinfo->servercolor == WHITE; + attron(A_UNDERLINE); + printw("Game details\n"); + attroff(A_UNDERLINE); + printw(" Server: %s\n Client: %s\n", + serverwhite?"White":"Black", serverwhite?"Black":"White" + ); + if (gameinfo->timecontrol) { + if (gameinfo->time % 60) { + printw(" Time limit: %ds + %ds\n", + gameinfo->time, gameinfo->addtime); + } else { + printw(" Time limit: %dm + %ds\n", + gameinfo->time/60, gameinfo->addtime); + } + } else { + printw(" No time limit\n"); + } + refresh(); +} + +void dump_moveinfo(GameState *gamestate) { + int i = 1; + for (MoveList *movelist = gamestate->movelist ; + movelist ; movelist = movelist->next) { + if (++i % 2 == 0) { + printw("%d. %s", i/2, movelist->move.string); + } else { + printw(" %s", movelist->move.string); + } + if (i % 20) { + addch(' '); + } else { + addch('\n'); + } + } + refresh(); +}