Esempio n. 1
0
        /// <summary>
        /// Makes an edge grid for this grid.
        /// </summary>
        public IGrid <TNewCell, PointyRhombPoint> MakeEdgeGrid <TNewCell>()
        {
            var edges   = this.SelectMany(x => x.GetEdges());
            var storage = PointyRhombGrid <TNewCell> .CalculateStorage(edges);

            var offset = PointyRhombGrid <TNewCell> .GridPointFromArrayPoint(storage.offset);

            return(new PointyRhombGrid <TNewCell>(storage.dimensions.X + 2, storage.dimensions.Y + 2, x => IsInsideEdgeGrid(x + offset), offset));
        }
Esempio n. 2
0
 protected override PointyHexPoint GridPointFromArrayPoint(ArrayPoint point)
 {
     return(PointyRhombGrid <TCell> .GridPointFromArrayPoint(point));
 }