Neco/LandView/GraphicsEngine.cs
/// <summary>Draws a single road onto a graphics</summary>
/// <param name="R">Road to draw</param>
/// <param name="GRM">Graphics to draw with</param>
/// <param name="Origin">Point on the given graphcis that represents 0,0</param>
/// <param name="C">Color to draw the road in</param>
Draws a single road onto a graphics
Draws a single road onto a graphics
public static void DrawRoad(Road R, Graphics GRM, Point Origin, Color C) {
            if (R.GraphicalPoints.Length < 2) { return; } 
            Pen RoadPen = new(C, R.Thickness);
            for (int i = 0; i < R.GraphicalPoints.Length - 1; i++) {
                GRM.DrawLine(RoadPen, OffsetPoint(Origin, R.GraphicalPoints[i]), OffsetPoint(Origin, R.GraphicalPoints[i + 1]));
            }
        }
public static void DrawRoad ( Road R , Graphics GRM , Point Origin , Color C ) { if ( R . GraphicalPoints . Length < 2 ) { return ; } Pen RoadPen = new ( C , R . Thickness ) ; for ( int i = 0 ; i < R . GraphicalPoints . Length - 1 ; i ++ ) { GRM . DrawLine ( RoadPen , OffsetPoint ( Origin , R . GraphicalPoints [ i ] ) , OffsetPoint ( Origin , R . GraphicalPoints [ i + 1 ] ) ) ; } }
Draws a single road onto a graphics
Draws a single road onto a graphics
//If it's less than 2 then we can't
R
Road
Road to draw
Road to draw
GRM
Graphics
Graphics to draw with
Graphics to draw with
Origin
Point
Point on the given graphcis that represents 0,0
Point on the given graphcis that represents 0 0
C
Color
Color to draw the road in
Color to draw the road in