示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#4
0
 static LuaUtils()
 {
     LuaHelper.RegisterType <Assembly>();
 }