Пример #1
0
        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;
        }
Пример #2
0
 public override void StartTurn(BoardObject boardObject)
 {
     _completed = false;
     StartCoroutine(CalculateMove(boardObject));
 }
Пример #3
0
 private void MoveRegistered(BoardObject board, Vector2Int coordinates)
 {
     board.moveRegistered -= MoveRegistered;
     board.board.SetPiece(coordinates, _role);
     _completed = true;
 }
Пример #4
0
 public override void StartTurn(BoardObject boardObject)
 {
     _completed = false;
     boardObject.moveRegistered += MoveRegistered;
 }
Пример #5
0
 public abstract void StartTurn(BoardObject boardObject);