예제 #1
0
        public void OnSetup()
        {
            Mock <ILogManager> mockLogManager = new Mock <ILogManager>();

            mockLogManager.Setup(x => x.Boot(It.IsAny <string>(), It.IsAny <object[]>()));

            const string dataPath = "D://Projects//SmaugCS//trunk//data";

            Mock <IKernel> mockKernel = new Mock <IKernel>();

            LuaMgr = new LuaManager(mockKernel.Object, mockLogManager.Object.LogWrapper);

            RepositoryManager dbMgr = new RepositoryManager(mockKernel.Object, mockLogManager.Object);

            LuaGetFunctions.InitializeReferences(LuaMgr, dbMgr, dataPath);
            LuaCreateFunctions.InitializeReferences(LuaMgr, dbMgr, mockLogManager.Object);

            var luaProxy = new LuaInterfaceProxy();

            var luaFuncRepo = LuaHelper.Register(typeof(LuaCreateFunctions), null);

            luaProxy.RegisterFunctions(luaFuncRepo);

            LuaMgr.InitializeLuaProxy(luaProxy);
        }
예제 #2
0
        public void OnSetup()
        {
            var mockKernel = new Mock <IKernel>();
            var mockCtx    = new Mock <ISmaugDbContext>();
            var mockLogger = new Mock <ILogWrapper>();
            var mockTimer  = new Mock <ITimer>();

            LuaManager luaMgr = new LuaManager(new Mock <IKernel>().Object, mockLogger.Object);
            LogManager logMgr = new LogManager(mockLogger.Object, mockKernel.Object, mockTimer.Object, mockCtx.Object, 0);

            var mockLogMgr          = new Mock <ILogManager>();
            RepositoryManager dbMgr = new RepositoryManager(mockKernel.Object, mockLogMgr.Object);

            LuaRoomFunctions.InitializeReferences(luaMgr, dbMgr, logMgr);
            LuaCreateFunctions.InitializeReferences(luaMgr, dbMgr, logMgr);

            dbMgr.ROOMS.CastAs <Repository <long, RoomTemplate> >().Clear();

            var proxy = new LuaInterfaceProxy();

            var luaFuncRepo = LuaHelper.Register(typeof(LuaRoomFunctions), null);

            luaFuncRepo = LuaHelper.Register(typeof(LuaCreateFunctions), luaFuncRepo);
            proxy.RegisterFunctions(luaFuncRepo);

            luaMgr.InitializeLuaProxy(proxy);
        }
예제 #3
0
        public void InitializeLuaProxy(LuaInterfaceProxy proxy)
        {
            Proxy = proxy ?? new LuaInterfaceProxy();
            var luaFuncRepo = LuaHelper.Register(typeof(LuaManager), null);

            Proxy.RegisterFunctions(luaFuncRepo);
        }
예제 #4
0
 public CharacterInstance(long id, string name)
     : base(id, name)
 {
     SavingThrows = new SavingThrowData();
     LuaVM        = new LuaInterfaceProxy();
     Timers       = new List <TimerData>();
     Act          = new ExtendedBitvector();
     AffectedBy   = new ExtendedBitvector();
 }
예제 #5
0
        public void InitializeLuaFunctions()
        {
            var proxy       = new LuaInterfaceProxy();
            var luaFuncRepo = new LuaFunctionRepository();

            LuaHelper.Register(typeof(LuaAreaFunctions), luaFuncRepo);
            LuaHelper.Register(typeof(LuaCreateFunctions), luaFuncRepo);
            LuaHelper.Register(typeof(LuaGetFunctions), luaFuncRepo);
            LuaHelper.Register(typeof(LuaMobFunctions), luaFuncRepo);
            LuaHelper.Register(typeof(LuaObjectFunctions), luaFuncRepo);
            LuaHelper.Register(typeof(LuaRoomFunctions), luaFuncRepo);
            LuaHelper.Register(typeof(LuaLookupFunctions), luaFuncRepo);
            LuaHelper.Register(typeof(LuaManagerFunctions), luaFuncRepo);
            LuaHelper.Register(typeof(LuaMudProgFunctions), luaFuncRepo);
            proxy.RegisterFunctions(luaFuncRepo);
            _luaManager.InitializeLuaProxy(proxy);
        }