/// <inheritdoc/> public virtual void PaintMap(DrawingContext graphics) { if (graphics == null) { throw new ArgumentNullException("graphics"); } // dc.InterpolationMode = InterpolationMode.HighQualityBicubic; var clipHexes = GetClipInHexes(HexPoint.Empty.ToWpfPoint(), MapSizeHexes.ToWpfSize()); var fontSize = SystemFonts.MenuFontSize * 0.8F; var brush = Brushes.Black; var textOffset = new HexPoint(GridSize.Scale(0.50F).ToSize()).ToWpfPoint() - new Vector(fontSize, fontSize); PaintForEachHex(graphics, clipHexes, coords => { this[coords].Paint(graphics); if (ShowHexgrid) { graphics.DrawGeometry(Brushes.Transparent, new Pen(Brushes.Black, 1), HexgridPath); } if (LandmarkToShow > 0) { graphics.DrawText(new FormattedText( LandmarkDistance(coords, LandmarkToShow - 1), CultureInfo.GetCultureInfo("en-US"), FlowDirection.LeftToRight, new Typeface("Verdana"), fontSize, Brushes.Black), textOffset); } }); graphics.Pop(); }
private IFastListX <T> InitializeBlock(Func <HexCoords, T> tFactory, int block_j, int block_i) { return((from j in Enumerable.Range(0, BlockSide) from i in Enumerable.Range(0, BlockSide) let coords = HexCoords.NewUserCoords(block_i + i, block_j + j) select MapSizeHexes.IsOnboard(coords) ? tFactory(coords) : default(T) ).ToArray().ToFastListX()); }