Пример #1
0
        private static void ParseOldWay(string pgn)
        {
            var parser = new PGNParser();
            var game   = parser.GetGamesFromPGNAsync(pgn).Result.ToArray();

            System.Console.WriteLine($"Parsed {game.Length} games.");
        }
Пример #2
0
        public static void TestParsingNagSymbols()
        {
            var parser    = new PGNParser();
            var game      = parser.GetGamesFromPGNAsync(PGNResources.MoveNagSymbol).Result;
            var formatter = new PgnFormatter <Move>(new PGNFormatterOptions());

            formatter.BuildPgn(game.First());
        }
Пример #3
0
        private static void Main(string[] args)
        {
            var parsePgn = new PGNParser();
            //parsePgn.ProgressUpdate += OnProgressUpdated;
            var sw    = new Stopwatch();
            var pgnDb = Encoding.UTF8.GetString(PGNResources.talLarge);

            sw.Start();
            var games = parsePgn.GetGamesFromPGNAsync(pgnDb).Result;

            sw.Stop();
            Console.WriteLine($"Parsed {games.Count()} games in {sw.ElapsedMilliseconds} ms.");
        }
Пример #4
0
        public static Game[] TestParsing(GameDatabase db)
        {
            var parser = new PGNParser();

            parser.UpdateProgress += UpdateProgress;
            var dbToUse = GetDbFromEnum(db);
            var timer   = new Stopwatch();

            timer.Start();
            var games = parser.GetGamesFromPGNAsync(dbToUse).Result.ToArray();

            timer.Stop();
            System.Console.WriteLine($"Parsing Finished {games.Length} games in {timer.ElapsedMilliseconds} ms.");
            return(games);
        }