|
|
@@ -388,53 +388,53 @@ bool ScriptController::isBool(const char* name)
|
|
|
return b;
|
|
|
}
|
|
|
|
|
|
-bool ScriptController::isNumber(const char* name)
|
|
|
-{
|
|
|
+bool ScriptController::isNumber(const char* name)
|
|
|
+{
|
|
|
lua_getglobal(_lua, name);
|
|
|
bool b = lua_isnumber(_lua, -1) != 0;
|
|
|
lua_pop(_lua, 1);
|
|
|
- return b;
|
|
|
-}
|
|
|
+ return b;
|
|
|
+}
|
|
|
|
|
|
-bool ScriptController::isString(const char* name)
|
|
|
-{
|
|
|
+bool ScriptController::isString(const char* name)
|
|
|
+{
|
|
|
lua_getglobal(_lua, name);
|
|
|
bool b = lua_isstring(_lua, -1) != 0;
|
|
|
lua_pop(_lua, 1);
|
|
|
- return b;
|
|
|
-}
|
|
|
+ return b;
|
|
|
+}
|
|
|
|
|
|
-bool ScriptController::isTable(const char* name)
|
|
|
-{
|
|
|
+bool ScriptController::isTable(const char* name)
|
|
|
+{
|
|
|
lua_getglobal(_lua, name);
|
|
|
bool b = lua_istable(_lua, -1) != 0;
|
|
|
lua_pop(_lua, 1);
|
|
|
- return b;
|
|
|
-}
|
|
|
+ return b;
|
|
|
+}
|
|
|
|
|
|
-bool ScriptController::isThread(const char* name)
|
|
|
-{
|
|
|
+bool ScriptController::isThread(const char* name)
|
|
|
+{
|
|
|
lua_getglobal(_lua, name);
|
|
|
bool b = lua_isthread(_lua, -1) != 0;
|
|
|
lua_pop(_lua, 1);
|
|
|
- return b;
|
|
|
-}
|
|
|
+ return b;
|
|
|
+}
|
|
|
|
|
|
-bool ScriptController::isUserData(const char* name)
|
|
|
-{
|
|
|
+bool ScriptController::isUserData(const char* name)
|
|
|
+{
|
|
|
lua_getglobal(_lua, name);
|
|
|
bool b = lua_isuserdata(_lua, -1) != 0;
|
|
|
lua_pop(_lua, 1);
|
|
|
- return b;
|
|
|
-}
|
|
|
-
|
|
|
-bool ScriptController::isFunction(const char* name)
|
|
|
-{
|
|
|
+ return b;
|
|
|
+}
|
|
|
+
|
|
|
+bool ScriptController::isFunction(const char* name)
|
|
|
+{
|
|
|
lua_getglobal(_lua, name);
|
|
|
bool b = lua_isfunction(_lua, -1) != 0;
|
|
|
lua_pop(_lua, 1);
|
|
|
- return b;
|
|
|
-}
|
|
|
+ return b;
|
|
|
+}
|
|
|
|
|
|
bool ScriptController::getBool(const char* name, bool defaultValue)
|
|
|
{
|