Skip to content

Instantly share code, notes, and snippets.

@randomguyeatspotato
Created April 3, 2018 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save randomguyeatspotato/65bf22714eae439223983d3d4aa49111 to your computer and use it in GitHub Desktop.
Save randomguyeatspotato/65bf22714eae439223983d3d4aa49111 to your computer and use it in GitHub Desktop.
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})
return GameState
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment