public void Set(ChessGame g) { idx = -1; move = null; total_moves = 0; if (g == null) { player = ChessGamePlayer. CreatePlayer (); return; } player = g.HasTag ("FEN") ? ChessGamePlayer. CreateFromFEN (g. GetTagValue ("FEN", null)) : ChessGamePlayer.CreatePlayer (); game = g; int n = game.Moves.Count; if (n > 0) { total_moves = n; } if (total_moves == 0) hasNext = false; else hasNext = true; }
void UpdateLabels(ChessGame game) { string white, black; if (game == null) { white = Catalog.GetString ("White"); black = Catalog.GetString ("Black"); } else { white = game.GetTagValue ("White", "White"); black = game. GetTagValue ("Black", "Black"); } white = GetMarkupForTitle (white); black = GetMarkupForTitle (black); if (boardWidget.WhiteAtBottom) { topLabel.Markup = black; bottomLabel.Markup = white; } else { topLabel.Markup = white; bottomLabel.Markup = black; } }