Skip to content

Instantly share code, notes, and snippets.

local enabledFunctions = require("gamestates/enabledFunctions")
local function emptyFunction() end
local function index(t, key) return getmetatable(t)[key] end
local function indexMeta(t, k) return enabledFunctions[key] and emptyFunction end
local function call(self) return setmetatable({}, self) end
local GameState = setmetatable({__index = index}, {__index = indexMeta, __call = call})