示例#1
0
        /**
         *      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));
        }
示例#2
0
 protected override DiamondPoint GridPointFromArrayPoint(ArrayPoint point)
 {
     return(DiamondGrid <TCell> .GridPointFromArrayPoint(point));
 }