public static LuaModule CreateModule(Table instance, LuaHelper luaHelper) { if (instance == null) { throw new ArgumentNullException(nameof(instance)); } if (luaHelper == null) { throw new ArgumentNullException(nameof(luaHelper)); } return(ObjectFactory.GetActivator <LuaModule>( typeof(LuaModule).GetConstructors().First())(instance, luaHelper)); }
public static ClassWrapper <ILuaPacket> CreatePacket(string interfaceName, Table table, LuaHelper luaHelper) { if (string.IsNullOrEmpty(interfaceName)) { throw new ArgumentNullException(nameof(interfaceName)); } if (table == null) { throw new ArgumentNullException(nameof(table)); } if (luaHelper == null) { throw new ArgumentNullException(nameof(luaHelper)); } var luaPacket = ObjectFactory.GetActivator <ILuaPacket>( typeof(LuaPacket).GetConstructors().First())(interfaceName, table, luaHelper); return(new ClassWrapper <ILuaPacket>(luaPacket)); }
public static ClassWrapper <LuaControllerComponent> CreateControllerComponent(Table instance, LuaHelper luaHelper) { if (instance == null) { throw new ArgumentNullException(nameof(instance)); } if (luaHelper == null) { throw new ArgumentNullException(nameof(luaHelper)); } var luaRpcComponent = ObjectFactory.GetActivator <LuaControllerComponent>( typeof(LuaControllerComponent).GetConstructors().First())(instance, luaHelper); return(new ClassWrapper <LuaControllerComponent>(luaRpcComponent)); }
static LuaUtils() { LuaHelper.RegisterType <Assembly>(); }