示例#1
0
        public static bool __CompilerHint2__Diamond__MeshTileCell()
        {
            //Ensures abstract super classes for base grids gets created
            var grid = new DiamondGrid <MeshTileCell>(1, 1, p => p == DiamondPoint.Zero, x => x, x => x, new List <DiamondPoint>());

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

            return(grid[grid.First()] == null || shapeInfo.Translate(DiamondPoint.Zero) != null);
        }
示例#2
0
        public static bool __CompilerHint__Diamond__MeshTileCell()
        {
            var grid = new DiamondGrid <MeshTileCell[]>(1, 1);

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

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

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

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

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

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