Esempio n. 1
0
        public static Point FindMaxMinPoint(GameManager i_Game)
        {
            int   maxMinScore = 0;
            Point maxMinPoint = new Point(0, 0);

            foreach (Point Move in i_Game.AvailableMoves)
            {
                GameManager ClonedGame = i_Game.Clone();
                ClonedGame.Board.MakeMove(Move, ClonedGame.ColorPlaying);
                ClonedGame.ColorPlaying = eCoinColor.Black;
                ClonedGame.UpdateAvailableMoves();
                if (ClonedGame.IsThereAvailableMove())
                {
                    int minScore = FindMinMovePointScore(ClonedGame) + GetRankOfPoint(Move, i_Game.Board.SizeOfBoard);
                    if (minScore > maxMinScore)
                    {
                        maxMinPoint = Move;
                        maxMinScore = minScore;
                    }
                }
                else
                {
                    return(Move);
                }
            }

            return(maxMinPoint);
        }