Skip to content

Commit

Permalink
by.get impl enum
Browse files Browse the repository at this point in the history
  • Loading branch information
alec1o committed May 6, 2024
1 parent 3db2b6d commit 5c97fe4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/by/By.Get.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,16 @@ public T Get<T>()

return value;
}
case Types.Enum:
{
if (!IsValidPrefix(type, sizeof(int))) return default;

value = (T)(object)BitConverter.ToInt32(Buffer, GetIndex());

AddIndex(sizeof(int));

return value;
}

default:
throw new NotImplementedException($"{type}");
Expand Down

0 comments on commit 5c97fe4

Please sign in to comment.