Neco/LandView/GraphicsEngine.cs
/// <summary>Draws the outline of a given district</summary>
/// <param name="D">District to draw</param>
/// <param name="GRM">Graphcis to draw onto</param>
/// <param name="Origin">Point that defines 0,0 on the given graphcis</param>
/// <param name="DistrictPen">Pen to draw the outline with</param>
Draws the outline of a given district
Draws the outline of a given district
public static void DrawDistrictOutline(District D, Graphics GRM, Point Origin, Pen DistrictPen) {
            if (D.GraphicalPoints.Length < 2) { return; } 
            for (int i = 0; i < D.GraphicalPoints.Length - 1; i++) {
                GRM.DrawLine(DistrictPen, OffsetPoint(Origin, D.GraphicalPoints[i]), OffsetPoint(Origin, D.GraphicalPoints[i + 1]));
            }
            GRM.DrawLine(DistrictPen, OffsetPoint(Origin, D.GraphicalPoints.First()), OffsetPoint(Origin, D.GraphicalPoints.Last()));
        }
public static void DrawDistrictOutline ( District D , Graphics GRM , Point Origin , Pen DistrictPen ) { if ( D . GraphicalPoints . Length < 2 ) { return ; } for ( int i = 0 ; i < D . GraphicalPoints . Length - 1 ; i ++ ) { GRM . DrawLine ( DistrictPen , OffsetPoint ( Origin , D . GraphicalPoints [ i ] ) , OffsetPoint ( Origin , D . GraphicalPoints [ i + 1 ] ) ) ; } GRM . DrawLine ( DistrictPen , OffsetPoint ( Origin , D . GraphicalPoints . First ( ) ) , OffsetPoint ( Origin , D . GraphicalPoints . Last ( ) ) ) ; }
Draws the outline of a given district
Draws the outline of a given district
//If it's less than 2 then we can't //Draw a line from the last point to the first point
D
District
District to draw
District to draw
GRM
Graphics
Graphcis to draw onto
Graphcis to draw onto
Origin
Point
Point that defines 0,0 on the given graphcis
Point that defines 0 0 on the given graphcis
DistrictPen
Pen
Pen to draw the outline with
Pen to draw the outline with