public override List<Tuple<int, int>> Detect(RemovalArgs args)
    {
        _args = args;
        int x = args.X;
        int y = args.Y;

        StoneColor oppositeColor = args.Rules.GetOppositeColor(x, y);

        List<Tuple<int, int>> toCheck = GetCheckPointsFor(x, y);
        List<Tuple<int, int>> results = new List<Tuple<int, int>>();
        toCheck.ForEach(delegate(Tuple<int, int> itemNextToCurrrent)
                            {

                                bool almostSurrounded = IsAlmostFullySurrounded(x, y, oppositeColor);
                                int xNextTome = itemNextToCurrrent.Item1;
                                int yNextTome = itemNextToCurrrent.Item2;

                                bool AlmostSurroundedToSomePosition = IsAlmostFullySurrounded(xNextTome, yNextTome, oppositeColor);

                                if (almostSurrounded && AlmostSurroundedToSomePosition)
                                {
                                    results.Add(new Tuple<int, int>(x, y));
                                    results.Add(new Tuple<int, int>(xNextTome, yNextTome));

                                }

                            });
        return results;
    }
示例#2
0
 public StoneRemover(RemovalArgs args)
 {
     _args = args;
 }
示例#3
0
 public abstract List<Tuple<int, int>> Detect(RemovalArgs args);