aboutsummaryrefslogtreecommitdiff
path: root/gamemode/utility
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/utility')
-rw-r--r--gamemode/utility/type.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/gamemode/utility/type.lua b/gamemode/utility/type.lua
new file mode 100644
index 0000000..61f1a8b
--- /dev/null
+++ b/gamemode/utility/type.lua
@@ -0,0 +1,11 @@
+
+local t = {}
+
+t.checktypes = function(...)
+ local args = {...}
+ for i = 1, #args, 2 do
+ assert(type(args[i]) == args[i + 1], string.format("Bad argument #%d, was %s, expected %s",(i + 1) / 2,type(args[i]),args[i + 1]))
+ end
+end
+
+return t