Ejemplo n.º 1
0
        // основание 3, основание 2, направлена от нас ( на правом боку )
        public static Tuple <bool, Point3D[]> position_F_3_B_2_B_R(Point3D point, Cub cub)
        {
            Point3D[] points = new Point3D[] {
                point.movePoint(0, 0, 0),
                point.movePoint(0, 1, 0),
                point.movePoint(0, 2, 0),
                point.movePoint(1, 2, 0),
                point.movePoint(1, 3, 0)
            };

            return(new Tuple <bool, Point3D[]>(canBeAccess(point, cub, points), points));
        }
Ejemplo n.º 2
0
        // основание 2, влево
        public static Tuple <bool, Point3D[]> position_F_2_3_L(Point3D point, Cub cub)
        {
            Point3D[] points = new Point3D[] {
                point.movePoint(0, 0, 0),
                point.movePoint(0, 0, 1),
                point.movePoint(-1, 0, 1),
                point.movePoint(-1, 0, 2),
                point.movePoint(-1, 0, 3)
            };

            return(new Tuple <bool, Point3D[]>(canBeAccess(point, cub, points), points));
        }
Ejemplo n.º 3
0
        // ---------------------------------------
        //****************************************

        // основание 2, верх 3, направлена к нам
        public static Tuple <bool, Point3D[]> position_B_2_B_3_U(Point3D point, Cub cub)
        {
            Point3D[] points = new Point3D[] {
                point.movePoint(0, 0, 0),
                point.movePoint(0, -1, 0),
                point.movePoint(0, -1, 1),
                point.movePoint(0, -2, 1),
                point.movePoint(0, -3, 1)
            };

            return(new Tuple <bool, Point3D[]>(canBeAccess(point, cub, points), points));
        }
Ejemplo n.º 4
0
        private static bool canBeAccess(Point3D point, Cub cub, Point3D[] points)
        {
            if (!point.inCub(cub.size, points.Last()))
            {
                return(false);
            }

            foreach (var p in points)
            {
                if (!cub.isFreePosition(p))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 5
0
        public Cub copy()
        {
            Cub cp = new Cub(size);

            for (int i = 0; i < size; ++i)
            {
                for (int j = 0; j < size; ++j)
                {
                    for (int k = 0; k < size; ++k)
                    {
                        cp.cub[i][j][k] = cub[i][j][k];
                    }
                }


                cp.filledLayers[i] = filledLayers[i];
            }

            cp.pentaminoesAmount = pentaminoesAmount;

            return(cp);
        }
Ejemplo n.º 6
0
        public int CompareTo(object obj)
        {
            Cub c = (Cub)obj;

            return(hueristicCost() - c.hueristicCost());
        }