示例#1
0
        public ScriptService(bool isServer,
                             ILogger logger,
                             ILoggingMethods loggingMethods,
                             IEntityMethods entityMethods,
                             ILocalDataMethods localDataMethods,
                             IPhysicsMethods physicsMethods,
                             IScriptingMethods scriptingMethods)
        {
            _logger = logger;

            _loggingMethods   = loggingMethods;
            _entityMethods    = entityMethods;
            _localDataMethods = localDataMethods;
            _physicsMethods   = physicsMethods;
            _scriptingMethods = scriptingMethods;

            _luaEngine   = new Lua();
            _scriptQueue = new Queue <ScriptQueueObject>();

            SandboxEngines();
            RegisterCommonMethods();

            if (isServer)
            {
                RegisterServerMethods();
                RegisterServerEnumerations();
            }
            else
            {
                RegisterClientMethods();
                RegisterClientEnumerations();
            }
        }
示例#2
0
        public ScriptManager(
            IFileSystem fileSystem,
            IAudioMethods audioMethods,
            IEntityMethods entityMethods,
            ILevelMethods levelMethods,
            ILocalDataMethods localDataMethods,
            IMiscellaneousMethods miscellaneousMethods,
            IPhysicsMethods physicsMethods,
            IPlayerMethods playerMethods,
            ISpriteMethods spriteMethods)
        {
            _fileSystem = fileSystem;

            _audioMethods         = audioMethods;
            _entityMethods        = entityMethods;
            _levelMethods         = levelMethods;
            _localDataMethods     = localDataMethods;
            _miscellaneousMethods = miscellaneousMethods;
            _physicsMethods       = physicsMethods;
            _playerMethods        = playerMethods;
            _spriteMethods        = spriteMethods;

            _scriptQueue = new Queue <ScriptQueueObject>();
            _luaEngine   = new Lua();
            SandboxVM();
            RegisterEnumerations();
            RegisterMethods();
        }