public void OppositeCornerPair(string name1, string name2, Dictionary <string, RDElement> dict, object factPool, Rule rule, Action <int> callBack, int callBackID)
        {
            FactPool pool = (FactPool)factPool;

            for (int x = 0; x <= pool.X; ++x)
            {
                for (int y = 0; y <= pool.Y; ++y)
                {
                    if (IsUnfinishedCorner(x + 1, y + 1, 0, 0, factPool) || IsUnfinishedCorner(x, y, 1, 1, factPool))
                    {
                        dict[name1] = new RDCorner(x + 1, y + 1, 0, 0);
                        dict[name2] = new RDCorner(x, y, 1, 1);
                        callBack.Invoke(callBackID);
                        dict[name2] = new RDCorner(x + 1, y + 1, 0, 0);
                        dict[name1] = new RDCorner(x, y, 1, 1);
                        callBack.Invoke(callBackID);
                    }
                    if (IsUnfinishedCorner(x + 1, y, 0, 1, factPool) || IsUnfinishedCorner(x, y + 1, 1, 0, factPool))
                    {
                        dict[name1] = new RDCorner(x + 1, y, 0, 1);
                        dict[name2] = new RDCorner(x, y + 1, 1, 0);
                        callBack.Invoke(callBackID);
                        dict[name2] = new RDCorner(x + 1, y, 0, 1);
                        dict[name1] = new RDCorner(x, y + 1, 1, 0);
                        callBack.Invoke(callBackID);
                    }
                }
            }
            dict.Remove(name1);
            dict.Remove(name2);
        }
        public void NumberCorner(string name, Dictionary <string, RDElement> dict, object factPool, Rule rule, Action <int> callBack, int callBackID)
        {
            FactPool pool = (FactPool)factPool;

            for (int x = 1; x <= pool.X; ++x)
            {
                for (int y = 1; y <= pool.Y; ++y)
                {
                    if (IsUnfinishedNumberCell(x, y, factPool))
                    {
                        for (int dx = 0; dx <= 1; ++dx)
                        {
                            for (int dy = 0; dy <= 1; ++dy)
                            {
                                if (IsUnfinishedCorner(x, y, dx, dy, factPool))
                                {
                                    dict[name] = new RDCorner(x, y, dx, dy);
                                    callBack.Invoke(callBackID);
                                }
                            }
                        }
                    }
                }
            }
            dict.Remove(name);
        }
Ejemplo n.º 3
0
 public RDList NearingEdgesOf(RDCorner corner, object factPool)
 {
     return(new RDList(new RDElement[]
     {
         new RDEdge(corner.X, corner.Y + corner.DY, true),
         new RDEdge(corner.X + corner.DX, corner.Y, false)
     }));
 }
Ejemplo n.º 4
0
 public RDList NearingCornerOf(RDCorner corner, object factPool)
 {
     return(new RDList(new RDCorner[]
     {
         new RDCorner(corner.X, corner.Y, 1 - corner.DX, corner.DY),
         new RDCorner(corner.X, corner.Y, corner.DX, 1 - corner.DY)
     }));
 }
Ejemplo n.º 5
0
 public RDCell CellOf(RDCorner corner, object factPool)
 {
     return(new RDCell(corner.X, corner.Y));
 }
Ejemplo n.º 6
0
 public RDCorner DiagonalCornerOf(RDCorner corner, object factPool)
 {
     return(new RDCorner(corner.X, corner.Y, 1 - corner.DX, 1 - corner.DY));
 }
Ejemplo n.º 7
0
 public RDCorner OppositeCornerOf(RDCorner corner, object factPool)
 {
     return(new RDCorner(corner.X + (corner.DX == 1?1:-1), corner.Y + (corner.DY == 1?1:-1), 1 - corner.DX, 1 - corner.DY));
 }