summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-04-04 17:42:12 +0100
committerrubenwardy <rw@rubenwardy.com>2018-04-04 17:42:12 +0100
commit5de9dcb7976f1c581601ab876d6bf3087991c4f6 (patch)
tree6897ade1d6e06d4bdd10d645bb93b254faf12b9e /api.lua
parent7c5fd79b57fad2b9485d801eea07c1c9fedaabe9 (diff)
Move api_helpers.lua in api.lua
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/api.lua b/api.lua
index 4cbf6cb..fd4b2dc 100644
--- a/api.lua
+++ b/api.lua
@@ -39,6 +39,19 @@ function awards.load()
end
awards.players = {}
end
+
+function awards.player(name)
+ local data = awards.players[name] or {}
+ awards.players[name] = data
+ data.name = data.name or name
+ data.unlocked = data.unlocked or {}
+ return data
+end
+
+function awards.player_or_nil(name)
+ return awards.players[name]
+end
+
--
-- local function make_on_reg_wrapper()
-- return function(def)