Ejemplo n.º 1
0
        private void NewGame()
        {
            BoardItems = Chess.BoardSetup();
            if (moves.Length > 0)
            {
                moves.Clear();
            }
            if (CheckMate)
            {
                CheckMate = false;
            }
            if (IsEngineThinking)
            {
                IsEngineThinking = false;
            }
            ResetSomeMembers();
            engine.SendCommand(UciCommands.ucinewgame);

            if (PlayerColor == PieceColor.Black)
            {
                engine.SendCommand(UciCommands.position);
                engine.SendCommand(UciCommands.go_movetime + " " + deepAnalysisTime.ToString());
                IsEngineThinking = true;
            }
        }
Ejemplo n.º 2
0
 public ChessViewModel(IEngineService es)
 {
     engine                = es;
     BoardItems            = Chess.BoardSetup();
     ctxTaskFactory        = new TaskFactory(TaskScheduler.FromCurrentSynchronizationContext());
     engine.EngineMessage += EngineMessage;
     engine.StartEngine();
 }