diff --git a/.gitignore b/.gitignore index d86d1ba..2e9693e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ obj -bin -.packages \ No newline at end of file +bin \ No newline at end of file diff --git a/Functional/Tuple.cs b/Functional/Tuple.cs index cf33904..e682d40 100644 --- a/Functional/Tuple.cs +++ b/Functional/Tuple.cs @@ -1,9 +1,44 @@ namespace SJK.Functional; +/// +/// Provides methods to convert values into tuples. +/// public static class TupleExtensions { + /// + /// Converts two values of any type into a tuple. + /// + /// The type of the first value. + /// The type of the second value. + /// The first value to convert. + /// The second value to convert. + /// A tuple containing both values. public static (T1, T2) ToTuple(this T1 first, T2 second) => (first, second); + + /// + /// Converts three values of any type into a tuple. + /// + /// The type of the first value. + /// The type of the second value. + /// The type of the third value. + /// The first value to convert. + /// The second value to convert. + /// The third value to convert. + /// A tuple containing all three values. public static (T1, T2, T3) ToTuple(this T1 first, T2 second, T3 third) => (first, second, third); + + /// + /// Converts four values of any type into a tuple. + /// + /// The type of the first value. + /// The type of the second value. + /// The type of the third value. + /// The type of the fourth value. + /// The first value to convert. + /// The second value to convert. + /// The third value to convert. + /// The fourth value to convert. + /// A tuple containing all four values. public static (T1, T2, T3, T4) ToTuple(this T1 first, T2 second, T3 third, T4 forth) => (first, second, third, forth); } diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/SjkScripts.csproj b/SjkScripts.csproj index 893510b..a2001fc 100644 --- a/SjkScripts.csproj +++ b/SjkScripts.csproj @@ -5,6 +5,7 @@ enable enable true + true