567 GameState gamestate; |
569 GameState gamestate; |
568 gamestate_init(&gamestate); |
570 gamestate_init(&gamestate); |
569 |
571 |
570 game_continue(settings, opponent, &gamestate); |
572 game_continue(settings, opponent, &gamestate); |
571 } |
573 } |
|
574 |
|
575 void dump_gameinfo(GameInfo *gameinfo) { |
|
576 int serverwhite = gameinfo->servercolor == WHITE; |
|
577 attron(A_UNDERLINE); |
|
578 printw("Game details\n"); |
|
579 attroff(A_UNDERLINE); |
|
580 printw(" Server: %s\n Client: %s\n", |
|
581 serverwhite?"White":"Black", serverwhite?"Black":"White" |
|
582 ); |
|
583 if (gameinfo->timecontrol) { |
|
584 if (gameinfo->time % 60) { |
|
585 printw(" Time limit: %ds + %ds\n", |
|
586 gameinfo->time, gameinfo->addtime); |
|
587 } else { |
|
588 printw(" Time limit: %dm + %ds\n", |
|
589 gameinfo->time/60, gameinfo->addtime); |
|
590 } |
|
591 } else { |
|
592 printw(" No time limit\n"); |
|
593 } |
|
594 refresh(); |
|
595 } |
|
596 |
|
597 void dump_moveinfo(GameState *gamestate) { |
|
598 int i = 1; |
|
599 for (MoveList *movelist = gamestate->movelist ; |
|
600 movelist ; movelist = movelist->next) { |
|
601 if (++i % 2 == 0) { |
|
602 printw("%d. %s", i/2, movelist->move.string); |
|
603 } else { |
|
604 printw(" %s", movelist->move.string); |
|
605 } |
|
606 if (i % 20) { |
|
607 addch(' '); |
|
608 } else { |
|
609 addch('\n'); |
|
610 } |
|
611 } |
|
612 refresh(); |
|
613 } |