From 4d3687f627467da7e97fbe5b876a48a8c373de9d Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Wed, 5 May 2021 13:15:12 +0200 Subject: [PATCH] feat: add enums --- sonic-radiance.love/birb/utils/enum.lua | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sonic-radiance.love/birb/utils/enum.lua diff --git a/sonic-radiance.love/birb/utils/enum.lua b/sonic-radiance.love/birb/utils/enum.lua new file mode 100644 index 0000000..a9b136e --- /dev/null +++ b/sonic-radiance.love/birb/utils/enum.lua @@ -0,0 +1,9 @@ +return function(tbl) + local length = #tbl + for i = 1, length do + local v = tbl[i] + tbl[v] = i + end + + return tbl +end \ No newline at end of file