From 829c24b6676dde1ed7cba55953d3190b8150e1a3 Mon Sep 17 00:00:00 2001 From: Drew Tingen Date: Tue, 9 Apr 2019 15:46:10 -0400 Subject: [PATCH] feat: Adding SPlusUtils to convert ushort's to int --- .../ICD.Common.Utils_SimplSharp.csproj | 1 + ICD.Common.Utils/SPlusUtils.cs | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 ICD.Common.Utils/SPlusUtils.cs diff --git a/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj b/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj index 58798fb..80364f1 100644 --- a/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj +++ b/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj @@ -186,6 +186,7 @@ + diff --git a/ICD.Common.Utils/SPlusUtils.cs b/ICD.Common.Utils/SPlusUtils.cs new file mode 100644 index 0000000..8e43542 --- /dev/null +++ b/ICD.Common.Utils/SPlusUtils.cs @@ -0,0 +1,20 @@ +using ICD.Common.Properties; + +namespace ICD.Common.Utils +{ + [PublicAPI("S+")] + public static class SPlusUtils + { + /// + /// Convert two ushort's to an int + /// + /// ushort for the least significant 16 bits + /// ushort for the most significant 1 bits + /// + [PublicAPI("S+")] + public static int ConvertToInt(ushort lowWord, ushort highWord) + { + return (highWord << 16) + lowWord; + } + } +} \ No newline at end of file