Example #1
0
		public static bool __CompilerHint__PointyHex__TileCell()
		{
			var grid = new PointyHexGrid<TileCell[]>(1, 1);

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

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

			return grid[grid.First()][0] == null || shapeInfo.Translate(PointyHexPoint.Zero) != null;
		}
		/** 
			Call this method if you use a PointyHexGrid.
			Replace	the type __CellType to whatever type you have in your grid.

			You can call the method anywhere in your code.
			
				if(!__CompilerHint__PointyHex()) return;

			This methods always returns true.

			@since 1.6
		*/
		public static bool __CompilerHint__PointyHex()
		{
			//Ensures abstract super classes for base grids gets created
			var grid = new PointyHexGrid<__CellType[]>(1, 1);

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

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

			return grid[grid.First()][0] == null || shapeInfo.Translate(PointyHexPoint.Zero) != null;
		}
Example #3
0
        public static bool __CompilerHint2__PointyHex()
        {
            //Ensures abstract super classes for base grids gets created
            var grid = new PointyHexGrid<__CellType>(1, 1, p => p == PointyHexPoint.Zero, x => x, x => x, new List<PointyHexPoint>());

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

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