diff --git a/X10D/src/BooleanExtensions.cs b/X10D/src/BooleanExtensions.cs deleted file mode 100644 index 1d81fda..0000000 --- a/X10D/src/BooleanExtensions.cs +++ /dev/null @@ -1,48 +0,0 @@ -namespace X10D -{ - /// - /// Extension methods for . - /// - public static class BooleanExtensions - { - /// - /// Gets the value of this boolean as represented by . - /// - /// The boolean. - /// Returns 1 if is , or 0 otherwise. - public static byte ToByte(this bool value) - { - return value ? 1 : 0; - } - - /// - /// Gets the value of this boolean as represented by . - /// - /// The boolean. - /// Returns 1 if is , or 0 otherwise. - public static short ToInt16(this bool value) - { - return value.ToByte(); - } - - /// - /// Gets the value of this boolean as represented by . - /// - /// The boolean. - /// Returns 1 if is , or 0 otherwise. - public static int ToInt32(this bool value) - { - return value.ToByte(); - } - - /// - /// Gets the value of this boolean as represented by . - /// - /// The boolean. - /// Returns 1 if is , 0 otherwise. - public static long ToInt64(this bool value) - { - return value.ToByte(); - } - } -} diff --git a/X10D/src/BooleanExtensions/BooleanExtensions.ToByte.cs b/X10D/src/BooleanExtensions/BooleanExtensions.ToByte.cs new file mode 100644 index 0000000..248de01 --- /dev/null +++ b/X10D/src/BooleanExtensions/BooleanExtensions.ToByte.cs @@ -0,0 +1,19 @@ +namespace X10D.BooleanExtensions +{ + public static partial class BooleanExtensions + { + /// + /// Converts the current to a 1-byte unsigned integer representing its truthiness. + /// + /// The value to convert. + /// + /// 1 if is + /// -or- + /// 0 otherwise. + /// + public static byte ToByte(this bool value) + { + return value ? 1 : 0; + } + } +} diff --git a/X10D/src/BooleanExtensions/BooleanExtensions.ToDecimal.cs b/X10D/src/BooleanExtensions/BooleanExtensions.ToDecimal.cs new file mode 100644 index 0000000..aba4031 --- /dev/null +++ b/X10D/src/BooleanExtensions/BooleanExtensions.ToDecimal.cs @@ -0,0 +1,19 @@ +namespace X10D.BooleanExtensions +{ + public static partial class BooleanExtensions + { + /// + /// Converts the current to a decimal floating-point number representing its truthiness. + /// + /// The value to convert. + /// + /// 1 if is + /// -or- + /// 0 otherwise. + /// + public static decimal ToDecimal(this bool value) + { + return value.ToByte(); + } + } +} diff --git a/X10D/src/BooleanExtensions/BooleanExtensions.ToDouble.cs b/X10D/src/BooleanExtensions/BooleanExtensions.ToDouble.cs new file mode 100644 index 0000000..6532dbb --- /dev/null +++ b/X10D/src/BooleanExtensions/BooleanExtensions.ToDouble.cs @@ -0,0 +1,19 @@ +namespace X10D.BooleanExtensions +{ + public static partial class BooleanExtensions + { + /// + /// Converts the current to a double-precision floating-point number representing its truthiness. + /// + /// The value to convert. + /// + /// 1 if is + /// -or- + /// 0 otherwise. + /// + public static long ToDouble(this bool value) + { + return value.ToByte(); + } + } +} diff --git a/X10D/src/BooleanExtensions/BooleanExtensions.ToInt16.cs b/X10D/src/BooleanExtensions/BooleanExtensions.ToInt16.cs new file mode 100644 index 0000000..bea5419 --- /dev/null +++ b/X10D/src/BooleanExtensions/BooleanExtensions.ToInt16.cs @@ -0,0 +1,19 @@ +namespace X10D.BooleanExtensions +{ + public static partial class BooleanExtensions + { + /// + /// Converts the current to a 2-byte signed integer representing its truthiness. + /// + /// The value to convert. + /// + /// 1 if is + /// -or- + /// 0 otherwise. + /// + public static short ToInt16(this bool value) + { + return value.ToByte(); + } + } +} diff --git a/X10D/src/BooleanExtensions/BooleanExtensions.ToInt32.cs b/X10D/src/BooleanExtensions/BooleanExtensions.ToInt32.cs new file mode 100644 index 0000000..d98015d --- /dev/null +++ b/X10D/src/BooleanExtensions/BooleanExtensions.ToInt32.cs @@ -0,0 +1,19 @@ +namespace X10D.BooleanExtensions +{ + public static partial class BooleanExtensions + { + /// + /// Converts the current to a 4-byte signed integer representing its truthiness. + /// + /// The value to convert. + /// + /// 1 if is + /// -or- + /// 0 otherwise. + /// + public static int ToInt32(this bool value) + { + return value.ToByte(); + } + } +} diff --git a/X10D/src/BooleanExtensions/BooleanExtensions.ToInt64.cs b/X10D/src/BooleanExtensions/BooleanExtensions.ToInt64.cs new file mode 100644 index 0000000..aae2858 --- /dev/null +++ b/X10D/src/BooleanExtensions/BooleanExtensions.ToInt64.cs @@ -0,0 +1,19 @@ +namespace X10D.BooleanExtensions +{ + public static partial class BooleanExtensions + { + /// + /// Converts the current to an 8-byte signed integer representing its truthiness. + /// + /// The value to convert. + /// + /// 1 if is + /// -or- + /// 0 otherwise. + /// + public static long ToInt64(this bool value) + { + return value.ToByte(); + } + } +} diff --git a/X10D/src/BooleanExtensions/BooleanExtensions.ToSingle.cs b/X10D/src/BooleanExtensions/BooleanExtensions.ToSingle.cs new file mode 100644 index 0000000..9dba0ea --- /dev/null +++ b/X10D/src/BooleanExtensions/BooleanExtensions.ToSingle.cs @@ -0,0 +1,19 @@ +namespace X10D.BooleanExtensions +{ + public static partial class BooleanExtensions + { + /// + /// Converts the current to a single-precision floating-point number representing its truthiness. + /// + /// The value to convert. + /// + /// 1 if is + /// -or- + /// 0 otherwise. + /// + public static float ToSingle(this bool value) + { + return value.ToByte(); + } + } +} diff --git a/X10D/src/BooleanExtensions/BooleanExtensions.ToUInt16.cs b/X10D/src/BooleanExtensions/BooleanExtensions.ToUInt16.cs new file mode 100644 index 0000000..32bd726 --- /dev/null +++ b/X10D/src/BooleanExtensions/BooleanExtensions.ToUInt16.cs @@ -0,0 +1,19 @@ +namespace X10D.BooleanExtensions +{ + public static partial class BooleanExtensions + { + /// + /// Converts the current to a 2-byte unsigned integer representing its truthiness. + /// + /// The value to convert. + /// + /// 1 if is + /// -or- + /// 0 otherwise. + /// + public static ushort ToUInt16(this bool value) + { + return value.ToByte(); + } + } +} diff --git a/X10D/src/BooleanExtensions/BooleanExtensions.ToUInt32.cs b/X10D/src/BooleanExtensions/BooleanExtensions.ToUInt32.cs new file mode 100644 index 0000000..2f7ece7 --- /dev/null +++ b/X10D/src/BooleanExtensions/BooleanExtensions.ToUInt32.cs @@ -0,0 +1,19 @@ +namespace X10D.BooleanExtensions +{ + public static partial class BooleanExtensions + { + /// + /// Converts the current to a 4-byte unsigned integer representing its truthiness. + /// + /// The value to convert. + /// + /// 1 if is + /// -or- + /// 0 otherwise. + /// + public static uint ToUInt32(this bool value) + { + return value.ToByte(); + } + } +} diff --git a/X10D/src/BooleanExtensions/BooleanExtensions.ToUInt64.cs b/X10D/src/BooleanExtensions/BooleanExtensions.ToUInt64.cs new file mode 100644 index 0000000..1acdf19 --- /dev/null +++ b/X10D/src/BooleanExtensions/BooleanExtensions.ToUInt64.cs @@ -0,0 +1,19 @@ +namespace X10D.BooleanExtensions +{ + public static partial class BooleanExtensions + { + /// + /// Converts the current to an 8-byte unsigned integer representing its truthiness. + /// + /// The value to convert. + /// + /// 1 if is + /// -or- + /// 0 otherwise. + /// + public static ulong ToUInt64(this bool value) + { + return value.ToByte(); + } + } +} diff --git a/X10D/src/BooleanExtensions/BooleanExtensions.cs b/X10D/src/BooleanExtensions/BooleanExtensions.cs new file mode 100644 index 0000000..706eb4b --- /dev/null +++ b/X10D/src/BooleanExtensions/BooleanExtensions.cs @@ -0,0 +1,9 @@ +namespace X10D.BooleanExtensions +{ + /// + /// Extension methods for . + /// + public static partial class BooleanExtensions + { + } +}