Example #1
0
        // Adapted from: https://github.com/MadLittleMods/svg-curve-lib/tree/master/src/c%2B%2B

        public static Vector2 LerpArc(this in (Vector2 p0, Vector2 p1, Vector2 rad, float xrotRadians, bool largeFlag, bool sweepFlag) arc, float t)
Example #2
0
 /// <summary>
 /// Interpolates over a cuadratic curve defined by 3 points
 /// </summary>
 public static Vector2 LerpCurve(this in (Vector2 P1, Vector2 P2, Vector2 P3) curve, float amount)
Example #3
0
 /// <summary>
 ///     Enumerates all positionf of the tiles adjacent to the current tile.
 /// </summary>
 /// <param name="tile">The postion of the tile.</param>
 /// <param name="pattern">The pattern that is used.</param>
 /// <returns></returns>
 /// <remarks>
 ///     The first tile is usually the north tile. The only tiles in a triangular pattern, with one odd and one even
 ///     coordinate. In that case first title is the south located tile. The following tiltes are enumerated counter
 ///     clockwise.
 /// </remarks>
 public static IEnumerable <(int X, int Y)> GetAdjacentTiles(this in (int x, int y) tile, TilePattern pattern)
Example #4
0
 /// <summary>Converts a frequency tuple to a `PhoneKey`.</summary>
 /// <param name="dtmfTone">The high and low frequencies as a `ValueTuple`.</param>
 /// <returns>The matching `PhoneKey` or `PhoneKey.None` in case the given frequencies don't encode a DTMF key.</returns>
 public static PhoneKey ToPhoneKey(this in (int high, int low) dtmfTone) => dtmfTone switch
Example #5
0
 /// <summary>
 /// Rotate 2d vector around z Axis clockwise
 /// </summary>
 /// <param name="vector">Vector to rotate</param>
 /// <param name="degrees">Angle of rotation</param>
 public static (float X, float Y) Rotate(this in (float X, float Y) vector, float degrees)
Example #6
0
 public static System.Drawing.RectangleF MinMaxToRectF(this in (XY Min, XY Max) minmax)
Example #7
0
 public static void AddTo <TKey, TValue>(this in (TKey Key, TValue Value) self, IDictionary <TKey, TValue> dictionary, bool overwrite)