Exemple #1
0
        public void StartRegion(ISimulationDataStore simData, RegionInfo regionInfo)
        {
            MainConsole.Instance.InfoFormat("[SceneManager]: Starting region \"{0}\" at @ {1},{2}",
                                            regionInfo.RegionName,
                                            regionInfo.RegionLocX / 256, regionInfo.RegionLocY / 256);
            ISceneLoader sceneLoader = m_SimBase.ApplicationRegistry.RequestModuleInterface <ISceneLoader>();

            if (sceneLoader == null)
            {
                throw new Exception("No Scene Loader Interface!");
            }

            //Get the new scene from the interface
            IScene scene = sceneLoader.CreateScene(simData, regionInfo);

            m_scenes.Add(scene);

            MainConsole.Instance.ConsoleScenes = m_scenes;
            simData.SetRegion(scene);
            m_simulationDataServices.Add(simData);

            if (OnAddedScene != null)
            {
                OnAddedScene(scene);
            }

            StartModules(scene);

            if (OnFinishedAddingScene != null)
            {
                OnFinishedAddingScene(scene);
            }

            //Start the heartbeats
            scene.StartHeartbeat();
            //Tell the scene that the startup is complete
            // Note: this event is added in the scene constructor
            scene.FinishedStartup("Startup", new List <string>());
        }
        public void StartRegion(ISimulationDataStore simData, RegionInfo regionInfo)
        {
            MainConsole.Instance.InfoFormat("[SceneManager]: Starting region \"{0}\" at @ {1},{2}",
                                            regionInfo.RegionName,
                                            regionInfo.RegionLocX/256, regionInfo.RegionLocY/256);
            ISceneLoader sceneLoader = m_SimBase.ApplicationRegistry.RequestModuleInterface<ISceneLoader>();
            if (sceneLoader == null)
                throw new Exception("No Scene Loader Interface!");

            //Get the new scene from the interface
            IScene scene = sceneLoader.CreateScene(simData, regionInfo);
            m_scenes.Add(scene);

            MainConsole.Instance.ConsoleScenes = m_scenes;
            simData.SetRegion(scene);
            m_simulationDataServices.Add(simData);

            if (OnAddedScene != null)
                OnAddedScene(scene);

            StartModules(scene);

            if (OnFinishedAddingScene != null)
                OnFinishedAddingScene(scene);

            //Start the heartbeats
            scene.StartHeartbeat();
            //Tell the scene that the startup is complete
            // Note: this event is added in the scene constructor
            scene.FinishedStartup("Startup", new List<string>());
        }