Beispiel #1
0
        public OpenLevel(OpenApi openApi,
                         OpenLevelManager levelManager,
                         string levelId,
                         IWorldProvider worldProvider,
                         EntityManager entityManager,
                         GameMode gameMode     = GameMode.Survival,
                         Difficulty difficulty = Difficulty.Normal,
                         int viewDistance      = 11)
            : base(levelManager, levelId,
                   (worldProvider is ICachingWorldProvider)
                                        ? new WrappedCachedWorldProvider(openApi, worldProvider)
                                        : new WrappedWorldProvider(openApi, worldProvider), entityManager, gameMode, difficulty,
                   viewDistance)
        {
            OpenAPI          = openApi;
            CancelationToken = new CancellationTokenSource();
            TickScheduler    = new TickScheduler();

            EventDispatcher = new EventDispatcher(openApi, OpenAPI.EventDispatcher);

            if (WorldProvider is WrappedWorldProvider wrapped)
            {
                wrapped.Level = this;
            }
        }
Beispiel #2
0
        protected override void OnInitialized(EventArgs e)
        {
            TickScheduler.Initialize(new TickToLogger());
            NoomStarter.Initialize(content, path, paging);

            base.OnInitialized(e);
        }
Beispiel #3
0
        public static void Initialize(IntPtr plugin)
        {
            TickScheduler.Initialize();
            Collections.Initialize(plugin);

            Start();
        }
Beispiel #4
0
        public override void Close()
        {
            if (_closed)
            {
                return;
            }

            _closed = true;
            CancelationToken.Dispose();
            TickScheduler.Close();
            base.Close();

            //OpenAPI.LevelManager.UnloadLevel(this);
        }