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;
            }
 public void Next()
 {
     idx++;
     move = (PGNChessMove) game.Moves[idx];
     if (idx == total_moves - 1)	// we have reached the last move. no more moves
         hasNext = false;
 }
 public void MoveFound(string movestr)
 {
     PGNChessMove move =
         new PGNChessMove (movestr);
       curMoves.Add (move);
 }