Exemplo n.º 1
0
        public int tryToPlace(Point pt, bool isBlack)
        {
            toFlip.Clear();
            toHint.ForEach(unhint);
            toHint.Clear();
            Space toPlace = board.tryToPlace(pt, isBlack);

            if (toPlace == null)
            {
                return(-1);
            }
            int score = findFlips(toPlace, false);

            if (score == -1)
            {
                return(-1);
            }
            if (toPlace.status == 3 || toPlace.status == -3)
            {
                toPlace.confirmHint(isBlack);
                toPlace.highLight();
                toFlip.ForEach(highlight);
                System.Threading.Thread.Sleep(10000);
            }
            if (!Form1.hintOn)
            {
                toPlace.placeDisc(isBlack);
            }
//            toHint.Remove(toPlace);
//            toHint.ForEach(unhint);
            if (isBlack)
            {
                blackPlayer.decCount();
                blackStack.drawStack(blackPlayer.discsLeft);
                blackPlayer.raiseScore(score + 1);
                whitePlayer.lowerScore(score);
            }
            else
            {
                whitePlayer.decCount();
                whiteStack.drawStack(whitePlayer.discsLeft);
                whitePlayer.raiseScore(score + 1);
                blackPlayer.lowerScore(score);
            }
            return(score);
        }