public CairoShapeInfo <TCell> Default(int width, int height) { var rawInfow = MakeShapeStorageInfo <CairoPoint>( width, height, x => CairoGrid <TCell> .DefaultContains(x, width, height)); return(new CairoShapeInfo <TCell>(rawInfow)); }
protected override void InitGrid() { VectorPoint rectDimensions = Dimensions; switch (shape) { case Shape.Rectangle: base.Grid = CairoGrid <TileCell> .Rectangle(rectDimensions.X, rectDimensions.Y); break; case Shape.Parallelogram: base.Grid = CairoGrid <TileCell> .Parallelogram(rectDimensions.X, rectDimensions.Y); break; case Shape.FatRectangle: base.Grid = CairoGrid <TileCell> .ThinRectangle(rectDimensions.X, rectDimensions.Y); break; case Shape.ThinRectangle: base.Grid = CairoGrid <TileCell> .FatRectangle(rectDimensions.X, rectDimensions.Y); break; case Shape.Hexagon: base.Grid = CairoGrid <TileCell> .Hexagon(Size); break; case Shape.UpTriangle: //base.Grid = CairoGrid<SpriteCell>.UpTriangle(Size); break; case Shape.DownTriangle: //base.Grid = CairoGrid<SpriteCell>.DownTriangle(Size); break; case Shape.Diamond: //base.Grid = CairoGrid<SpriteCell>.Diamond(Size); break; case Shape.Single: base.Grid = CairoGrid <TileCell> .Single(); break; case Shape.Custom: var shapeBuilder = GetComponent <CustomGridBuilder>(); base.Grid = shapeBuilder.MakeGrid <TileCell, CairoPoint>(); break; default: throw new ArgumentOutOfRangeException(); } }
public static bool __CompilerHint__Cairo__MeshTileCell() { var grid1 = new PointyHexGrid <MeshTileCell[]>(1, 1); foreach (var point in grid1) { grid1[point] = new MeshTileCell[1]; } var grid2 = new CairoGrid <MeshTileCell>(1, 1); foreach (var point in grid2) { grid2[point] = null; } var shapeStorageInfo = new ShapeStorageInfo <CairoPoint>(new IntRect(), p => true); var shapeInfo = new CairoShapeInfo <MeshTileCell>(shapeStorageInfo); return(grid1[grid1.First()][0] == null || grid2[grid2.First()] == null || shapeInfo.IncIndex(0) != null); }
protected override ArrayPoint ArrayPointFromGridPoint(PointyHexPoint point) { return(CairoGrid <TCell> .ArrayPointFromGridPoint(point)); }
protected override PointyHexPoint GridPointFromArrayPoint(ArrayPoint point) { return(CairoGrid <TCell> .GridPointFromArrayPoint(point)); }
/** * Starts a compound shape operation. * * Any shape that is defined in terms of other shape operations must use this method, and use Endgroup() to end the definition. * * public static CairoShapeInfo<TCell> MyCustomShape(this CairoOp<TCell> op) * { * return * BeginGroup() * .Shape1() * .Union() * .Shape2() * .EndGroup(op); * } * * @since 1.1 */ public CairoOp <TCell> BeginGroup() { return(CairoGrid <TCell> .BeginShape()); }