示例#1
0
        public void AsyncMoveAiSimple(ChessAiAsyncTurnKey key, ChessAiMoveResult result)
        {
            Debug.Assert(AiState == ChessAiState.WaitingForWorker);
            AiState = ChessAiState.InProgress;

            ChessPieceCoord from = null, to = null;
            var             moveResult = Logic.AsyncCalculateAiSimpleMove(key, ref from, ref to);

            result.SetResult(moveResult, from, to);

            AiState = ChessAiState.WaitingForFinish;
        }
示例#2
0
        public void AsyncMoveAiComplex(ChessAiAsyncTurnKey key, ChessAiMoveResult result)
        {
            Debug.Assert(AiState == ChessAiState.WaitingForWorker);
            AiState = ChessAiState.InProgress;

            ChessPieceCoord from = null, to = null;
            uint            counter    = 0;
            var             moveResult = Logic.AsyncCalculateAiComplexMove(key, ref from, ref to, ref counter);

            result.SetResult(moveResult, from, to);
            result.ProfilingCounter = counter;

            AiState = ChessAiState.WaitingForFinish;
        }