diff options
-rw-r--r-- | util.lua | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,6 +1,6 @@ -- -- Agario Checkers - Checkers-like game with inspiration from agar.io --- Copyright (C) 2017 Delwink, LLC +-- Copyright (C) 2017-2018 Delwink, LLC -- -- Redistributions, modified or unmodified, in whole or in part, must retain -- applicable copyright or other legal privilege notices, these conditions, and @@ -36,6 +36,14 @@ -- OF OR OTHER DEALINGS IN THE WORK. -- +function functionize(v) + if type(v) ~= 'function' then + return function(self) return v end + end + + return v +end + function string:startswith(pattern) return self:sub(1, pattern:len()) == pattern end |