コード例 #1
0
		public static bool __CompilerHint__Diamond__TileCell()
		{
			var grid = new DiamondGrid<TileCell[]>(1, 1);

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

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

			return grid[grid.First()][0] == null || shapeInfo.Translate(DiamondPoint.Zero) != null;
		}
コード例 #2
0
		public static bool __CompilerHint2__Diamond__TileCell()
		{
			//Ensures abstract super classes for base grids gets created
			var grid = new DiamondGrid<TileCell>(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<TileCell>(shapeStorageInfo);

			return grid[grid.First()] == 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 __CompilerHint1__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;
        }