Exemplo n.º 1
0
 public void Solve(GoBoard goBoard, Color color)
 {
     Board = goBoard;
     Color = color;
     SafetySolver.Solve(goBoard, color);
     ProtectedLiberitiesLeft = GoBoardHelper.GetProtectedLiberites(Board, color);
 }
Exemplo n.º 2
0
        public void PrioritizeMoves(MoveList moves, Color playerToMove)
        {
            List <int>[] lProtected = new List <int> [2];
            lProtected[0] = GoBoardHelper.GetProtectedLiberites(Board, playerToMove);
            lProtected[1] = GoBoardHelper.GetProtectedLiberites(Board, playerToMove.Opposite);

            List <int>[] lNeighborsOfProtected = new List <int> [2];
            lNeighborsOfProtected[0] = GoBoardHelper.GetNeighbors(Board, lProtected[0]);
            lNeighborsOfProtected[1] = GoBoardHelper.GetNeighbors(Board, lProtected[1]);

            foreach (int lMove in moves)
            {
                moves.SetValue(lMove, GetMovePriority(lMove, playerToMove, lProtected[0].Contains(lMove), lProtected[1].Contains(lMove), lNeighborsOfProtected[0].Contains(lMove), lNeighborsOfProtected[1].Contains(lMove)));
            }
        }