コード例 #1
0
        /**
            Call this method if you use a FlatHexGrid.
            Replace	the type __CellType to whatever type you have in your grid.

            You can call the method anywhere in your code.

                if(!__CompilerHint__FlatHex()) return;

            This methods always returns true.

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

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

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

            return grid[grid.First()][0] == null || shapeInfo.Translate(FlatHexPoint.Zero) != null;
        }
コード例 #2
0
ファイル: CompilerHints.cs プロジェクト: mhaque3/soa_unity
        /**
         *      Call this method if you use a CairoGrid.
         *      Replace	the type __CellType to whatever type you have in your grid.
         *
         *      You can call the method anywhere in your code.
         *
         *              if(!__CompilerHint__Cairo()) return;
         *
         *      This methods always returns true.
         *
         *      @since 1.6
         */
        public static bool __CompilerHint__Cairo()
        {
            //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 <CairoPoint>(new IntRect(), p => true);
            var shapeInfo        = new CairoShapeInfo <__CellType>(shapeStorageInfo);

            return(grid[grid.First()][0] == null || shapeInfo.IncIndex(0) != null);
        }
コード例 #3
0
ファイル: CompilerHints.cs プロジェクト: mhaque3/soa_unity
        /**
         *      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);
        }
コード例 #4
0
		/** 
			Call this method if you use a CairoGrid.
			Replace	the type __CellType to whatever type you have in your grid.

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

			This methods always returns true.

			@since 1.6
		*/
		public static bool __CompilerHint__Cairo()
		{
			//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<CairoPoint>(new IntRect(), p => true);
			var shapeInfo = new CairoShapeInfo<__CellType>(shapeStorageInfo);

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