/** * Makes an edge grid for this grid. */ public IGrid <TNewCell, DiamondPoint> MakeEdgeGrid <TNewCell>() { var edges = this.SelectMany(x => x.GetEdges()); var storage = DiamondGrid <TNewCell> .CalculateStorage(edges); var offset = DiamondGrid <TNewCell> .GridPointFromArrayPoint(storage.offset); return(new DiamondGrid <TNewCell>(storage.dimensions.X, storage.dimensions.Y, x => IsInsideEdgeGrid(x + offset), offset)); }
protected override DiamondPoint GridPointFromArrayPoint(ArrayPoint point) { return(DiamondGrid <TCell> .GridPointFromArrayPoint(point)); }