From 2790dcbf0d9a9822a8e18a9246efd87b59032959 Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 2 Jul 2015 14:29:19 -0400 Subject: [PATCH] lua - implement userdata.containskey() --- BizHawk.Client.Common/lua/EmuLuaLibrary.UserData.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/BizHawk.Client.Common/lua/EmuLuaLibrary.UserData.cs b/BizHawk.Client.Common/lua/EmuLuaLibrary.UserData.cs index f496134588..4d58ab6424 100644 --- a/BizHawk.Client.Common/lua/EmuLuaLibrary.UserData.cs +++ b/BizHawk.Client.Common/lua/EmuLuaLibrary.UserData.cs @@ -61,5 +61,14 @@ namespace BizHawk.Client.EmuHawk { return Global.UserBag.Remove(key); } + + [LuaMethodAttributes( + "containskey", + "returns whether or not there is an entry for the given key" + )] + public bool ContainsKey(string key) + { + return Global.UserBag.ContainsKey(key); + } } }