lua/wrappers/game/lua_door.cpp
/**
	 * Sets the lock type by lock name.
	 *
	 * @param string lock_name The name of the lock type.
	 * @returns am.door This
	 */
Sets the lock type by lock name.
@param string lock_name The name of the lock type.
Sets the lock type by lock name . @param string lock_name The name of the lock type .
int Door_lock(lua_State *lua)
	{
		Door *door = castUData<Door>(lua, 1);
		if (door)
		{
			if (lua_gettop(lua) == 1)
			{
				lua_pushstring(lua, Door::getLockTypeName(door->getLock()));
				return 1;
			}
			else if (lua_isstr(lua, 2))
			{
				Door::LockType lock = Door::getLockType(lua_tostring(lua, 2));
				if (lock != Door::MAX_LOCK_TYPE)
				{
					door->setLock(lock);
				}
				else
				{
					std::stringstream ss;
					ss << "Unknown lock type '" << lua_tostring(lua, 2) << '\'';
					LuaState::warning(lua, ss.str().c_str());
				}
				lua_first(lua);
			}
			return LuaState::expectedArgs(lua, "lock", "string lock_name");
		}
		return LuaState::expectedContext(lua, "lock", "am.door");
	}
int Door_lock ( lua_State * lua ) { Door * door = castUData < Door > ( lua , 1 ) ; if ( door ) { if ( lua_gettop ( lua ) == 1 ) { lua_pushstring ( lua , Door :: getLockTypeName ( door -> getLock ( ) ) ) ; return 1 ; } else if ( lua_isstr ( lua , 2 ) ) { Door :: LockType lock = Door :: getLockType ( lua_tostring ( lua , 2 ) ) ; if ( lock != Door :: MAX_LOCK_TYPE ) { door -> setLock ( lock ) ; } else { std :: stringstream ss ; ss << " " << lua_tostring ( lua , 2 ) << ' \' ' ; LuaState :: warning ( lua , ss . str ( ) . c_str ( ) ) ; } lua_first ( lua ) ; } return LuaState :: expectedArgs ( lua , " " , " " ) ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Sets the lock type by lock name.
Sets the lock type by lock name .