protected void SetMoveInfo(CairoBoard board, MoveDetails details) { string notation = details.verbose_notation; if (notation.Equals ("none")) return; char src_rank, src_file, dst_rank, dst_file; if (notation.ToLower ().Equals ("o-o")) { src_file = 'e'; // Note: whiteToMove indicates that black made the move! src_rank = dst_rank = details. whiteToMove ? '8' : '1'; dst_file = 'g'; } else if (notation.ToLower ().Equals ("o-o-o")) { src_file = 'e'; // Note: whiteToMove indicates that black made the move! src_rank = dst_rank = details. whiteToMove ? '8' : '1'; dst_file = 'c'; } else { int idx = notation.IndexOf ('/'); idx++; src_file = notation[idx++]; src_rank = notation[idx++]; idx++; // skip extra char dst_file = notation[idx++]; dst_rank = notation[idx++]; } board.SetMoveInfo (src_rank - '1', src_file - 'a', dst_rank - '1', dst_file - 'a'); }
protected virtual void InitGameWidget(MoveDetails details) { board = new CairoViewerBoard (details.pos); gameWidget = new ChessGameWidget (board); }
protected void UpdateTitleLabelForMove(CairoBoard board, MoveDetails details) { string notation = details.verbose_notation; if (notation.Equals ("none")) return; if (details.WhiteMoved) resultLabel.Markup = String. Format ("<b>{0}. {1}</b>", details.movenumber, details. pretty_notation); else resultLabel.Markup = String. Format ("<b>{0}... {1}</b>", details.movenumber - 1, details. pretty_notation); }
protected virtual void InitGameWidget(MoveDetails details) { board = new CairoViewerBoard (details.pos); board.showAnimations = App.Session.showAnimations; gameWidget = new ChessGameWidget (board); }