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; }
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; }