Exemple #1
0
        public MatchRunner(IPlayer white, IPlayer black, TimeSettings timeSettings)
        {
            TimeSettings = timeSettings;
            PlayerWhite = white;
            PlayerBlack = black;

            var matchName = DateTime.Now.ToString("yyyyMMdd-HHmmss") + "-" + PlayerWhite.Name + "-" + PlayerBlack.Name;
            var dir = Path.Combine(OutputDir, matchName);
            Directory.CreateDirectory(dir);
            var fileWhite = Path.Combine(dir, "white.log");
            var fileBlack = Path.Combine(dir, "black.log");
            fsWhite = new FileStream(fileWhite, FileMode.CreateNew, FileAccess.Write, FileShare.Read);
            fsBlack = new FileStream(fileBlack, FileMode.CreateNew, FileAccess.Write, FileShare.Read);
            writerWhite = new StreamWriter(fsWhite);
            writerBlack = new StreamWriter(fsBlack);
            Board = new Base.Board(true);
            Clock = new ChessClock(TimeSettings);
        }
Exemple #2
0
        public MatchRunner(IPlayer white, IPlayer black, TimeSettings timeSettings)
        {
            TimeSettings = timeSettings;
            PlayerWhite  = white;
            PlayerBlack  = black;

            var matchName = DateTime.Now.ToString("yyyyMMdd-HHmmss") + "-" + PlayerWhite.Name + "-" + PlayerBlack.Name;
            var dir       = Path.Combine(OutputDir, matchName);

            Directory.CreateDirectory(dir);
            var fileWhite = Path.Combine(dir, "white.log");
            var fileBlack = Path.Combine(dir, "black.log");

            fsWhite     = new FileStream(fileWhite, FileMode.CreateNew, FileAccess.Write, FileShare.Read);
            fsBlack     = new FileStream(fileBlack, FileMode.CreateNew, FileAccess.Write, FileShare.Read);
            writerWhite = new StreamWriter(fsWhite);
            writerBlack = new StreamWriter(fsBlack);
            Board       = new Base.Board(true);
            Clock       = new ChessClock(TimeSettings);
        }