public IEnumerator CalculateMove(BoardObject boardObject) { Piece win = Piece.None; var miniMax = new MiniMax(boardObject.board, (int)_difficulty, true, _role); while (miniMax.MoveNext()) { yield return(null); } var(_, move) = miniMax.GetBest(); if (move != null) { boardObject.board.SetPiece(move.Item1, move.Item2, _role); } _completed = true; }
public override void StartTurn(BoardObject boardObject) { _completed = false; StartCoroutine(CalculateMove(boardObject)); }
private void MoveRegistered(BoardObject board, Vector2Int coordinates) { board.moveRegistered -= MoveRegistered; board.board.SetPiece(coordinates, _role); _completed = true; }
public override void StartTurn(BoardObject boardObject) { _completed = false; boardObject.moveRegistered += MoveRegistered; }
public abstract void StartTurn(BoardObject boardObject);