add bool and ushort extensions

This commit is contained in:
Jack Kanarish
2018-05-03 11:56:09 -04:00
parent d22c3c2cd2
commit 9b1ddf41d2
2 changed files with 20 additions and 0 deletions

View File

@@ -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;
}
}
}

View File

@@ -0,0 +1,10 @@
namespace ICD.Common.Utils.Extensions
{
public static class UshortExtensions
{
public static bool ToBool(this ushort u)
{
return u != 0;
}
}
}