fix: allow for empty lines in Fens.txt file

This commit is contained in:
Joshua Jeschek 2023-07-22 22:41:25 +02:00
parent d4dd023852
commit 3863675e6a
No known key found for this signature in database
GPG key ID: 81D437345CB6EEB4

View file

@ -3,6 +3,7 @@ using ChessChallenge.Example;
using Raylib_cs; using Raylib_cs;
using System; using System;
using System.IO; using System.IO;
using System.Linq;
using System.Runtime.ExceptionServices; using System.Runtime.ExceptionServices;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
@ -66,7 +67,7 @@ namespace ChessChallenge.Application
BotStatsA = new BotMatchStats("IBot"); BotStatsA = new BotMatchStats("IBot");
BotStatsB = new BotMatchStats("IBot"); BotStatsB = new BotMatchStats("IBot");
botMatchStartFens = FileHelper.ReadResourceFile("Fens.txt").Split('\n'); botMatchStartFens = FileHelper.ReadResourceFile("Fens.txt").Split('\n').Where(fen => fen.Length > 0).ToArray();
botTaskWaitHandle = new AutoResetEvent(false); botTaskWaitHandle = new AutoResetEvent(false);
StartNewGame(PlayerType.Human, PlayerType.MyBot); StartNewGame(PlayerType.Human, PlayerType.MyBot);