Ejemplo n.º 1
0
        public static bool __CompilerHint2__Rect__MeshTileCell()
        {
            //Ensures abstract super classes for base grids gets created
            var grid = new RectGrid <MeshTileCell>(1, 1, p => p == RectPoint.Zero, x => x, x => x, new List <RectPoint>());

            //Ensures shape infpo classes get created
            var shapeStorageInfo = new ShapeStorageInfo <RectPoint>(new IntRect(), p => true);
            var shapeInfo        = new RectShapeInfo <MeshTileCell>(shapeStorageInfo);

            return(grid[grid.First()] == null || shapeInfo.Translate(RectPoint.Zero) != null);
        }
Ejemplo n.º 2
0
        public static bool __CompilerHint__Rect__MeshTileCell()
        {
            var grid = new RectGrid <MeshTileCell[]>(1, 1);

            foreach (var point in grid)
            {
                grid[point] = new MeshTileCell[1];
            }

            var shapeStorageInfo = new ShapeStorageInfo <RectPoint>(new IntRect(), p => true);
            var shapeInfo        = new RectShapeInfo <MeshTileCell>(shapeStorageInfo);

            return(grid[grid.First()][0] == null || shapeInfo.Translate(RectPoint.Zero) != null);
        }
Ejemplo n.º 3
0
        /**
         *      Call this method if you use a RectGrid.
         *      Replace	the type __CellType to whatever type you have in your grid.
         *
         *      You can call the method anywhere in your code.
         *
         *              if(!__CompilerHint__Rect()) return;
         *
         *      This methods always returns true.
         *
         *      @since 1.6
         */
        public static bool __CompilerHint__Rect()
        {
            //Ensures abstract super classes for base grids gets created
            var grid = new RectGrid <__CellType[]>(1, 1);

            foreach (var point in grid)
            {
                grid[point] = new __CellType[1];
            }

            //Ensures shape infpo classes get created
            var shapeStorageInfo = new ShapeStorageInfo <RectPoint>(new IntRect(), p => true);
            var shapeInfo        = new RectShapeInfo <__CellType>(shapeStorageInfo);

            return(grid[grid.First()][0] == null || shapeInfo.Translate(RectPoint.Zero) != null);
        }