diff --git a/ICD.Common.Utils/Extensions/BoolExtensions.cs b/ICD.Common.Utils/Extensions/BoolExtensions.cs new file mode 100644 index 0000000..53c2ee7 --- /dev/null +++ b/ICD.Common.Utils/Extensions/BoolExtensions.cs @@ -0,0 +1,10 @@ +namespace ICD.Common.Utils.Extensions +{ + public static class BoolExtensions + { + public static ushort ToUshort(this bool b) + { + return b ? (ushort)1 : (ushort)0; + } + } +} \ No newline at end of file diff --git a/ICD.Common.Utils/Extensions/UshortExtensions.cs b/ICD.Common.Utils/Extensions/UshortExtensions.cs new file mode 100644 index 0000000..e31c463 --- /dev/null +++ b/ICD.Common.Utils/Extensions/UshortExtensions.cs @@ -0,0 +1,10 @@ +namespace ICD.Common.Utils.Extensions +{ + public static class UshortExtensions + { + public static bool ToBool(this ushort u) + { + return u != 0; + } + } +} \ No newline at end of file