From 5c97fe4daf4acd0345922481bd2eccebb9815a5c Mon Sep 17 00:00:00 2001 From: Alecio Furanze Date: Mon, 6 May 2024 20:09:06 +0200 Subject: [PATCH] by.get impl enum --- src/by/By.Get.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/by/By.Get.cs b/src/by/By.Get.cs index ad0ea88..e65dd94 100644 --- a/src/by/By.Get.cs +++ b/src/by/By.Get.cs @@ -230,6 +230,16 @@ public T Get() 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}");