void DrawBGBorder() { using (var border = new Pen(Color.Black, MazeSettings.CurrentBorderSize)) { MapRows.ToList().ForEach(a => MzGraphics.DrawLine(border, new PointF(MapRectF.X, a), new PointF(MapRectF.Right, a))); MapCols.ToList().ForEach(a => MzGraphics.DrawLine(border, new PointF(a, MapRectF.Y), new PointF(a, MapRectF.Bottom))); } }
void DrawFGColMask(Pen empty, int x, int y) { if ((x >= 0 && x <= MapSize.Width) && (y >= 0 && y < MapSize.Height)) { var X = MapCols.ElementAt(x); var Y = MapRows.ElementAt(y); var Blank = SizeZoomF.Height / DoorBlank; MzGraphics.DrawLine(empty, new PointF(X, Y + Blank), new PointF(X, Y + SizeZoomF.Height - Blank)); } }
void DrawBGDotted() { using (var dotted = new Pen(Color.Gray, 1)) { dotted.DashStyle = DashStyle.Dash; MapRows.ToList().Aggregate((a, n) => { var x = (a + n) / 2; MzGraphics.DrawLine(dotted, new PointF(MapRectF.X, x), new PointF(MapRectF.Right, x)); return(n); }); MapCols.ToList().Aggregate((a, n) => { var x = (a + n) / 2; MzGraphics.DrawLine(dotted, new PointF(x, MapRectF.Y), new PointF(x, MapRectF.Bottom)); return(n); }); } }
void DrawUnvisitedRoom() { if (MzSolvePath == null || MzSolvePath.Count == 0) { return; } SolidBrush brush = new SolidBrush(Color.LightGray); for (int col = 0; col < MapSize.Width; col++) { for (int row = 0; row < MapSize.Height; row++) { if (MzSolveMap[col, row] == Closed) { RectangleF rect = new RectangleF(new PointF(MapCols.ElementAt(col), MapRows.ElementAt(row)), SizeZoomF); rect.Inflate(new SizeF(-1, -1)); MzGraphics.FillRectangle(brush, rect); } } } }
PointF GetHalfLinePoint(Point point) { return(new PointF((MapCols.ElementAt(point.X) + MapCols.ElementAt(point.X + 1)) / 2, (MapRows.ElementAt(point.Y) + MapRows.ElementAt(point.Y + 1)) / 2)); }