Exemple #1
0
        /// <summary>Paint the direction and destination indicators for each hex of the current shortest path.</summary>
        /// <param name="this">Type: MapDisplay{THex} - The map to be painted.</param>
        /// <param name="graphics">Type: Graphics - Object representing the canvas being painted.</param>
        /// <param name="path">Type: <see cref="IDirectedPathCollection"/> -
        /// A directed path (ie linked-list> of hexes to be highlighted with a direction arrow.</param>
        static void PaintPathArrow <THex>(this MapDisplay <THex> @this, Graphics graphics, IDirectedPathCollection path
                                          ) where THex : MapGridHex
        {
            if (graphics == null)
            {
                throw new ArgumentNullException("graphics");
            }
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }

            graphics.TranslateTransform(@this.CentreOfHexOffset.Width, @this.CentreOfHexOffset.Height);
            if (path.PathSoFar == null)
            {
                @this.PaintPathDestination(graphics);
            }
            else
            {
                @this.PaintPathArrow(graphics, path.PathStep.HexsideEntry);
            }
        }