public void AddSceneContainer(SceneContainer sceneContainer)
        {
            _sceneContainer = sceneContainer;

            if (!_game.Components.Contains(sceneContainer))
            {
                _game.Components.Add(sceneContainer);
            }
        }
Exemple #2
0
        public void SwitchScene(string sceneName)
        {
            if (!_scenes.ContainsKey(sceneName))
            {
                return;
            }

            _previousScene = sceneName;
            GameScene            scene           = _scenes[sceneName];
            SceneContainer       sceneContainer  = scene.GetSceneContainer();
            List <GameComponent> sceneComponents = sceneContainer.sceneComponents;

            sceneComponents.Add(sceneContainer);

            foreach (GameComponent component in _game.Components)
            {
                bool isUsed = sceneComponents.Contains(component);
                _game.ToggleComponentState(component, isUsed);
            }

            Mouse.SetCursor(MouseCursor.Arrow);
        }
 public GameScene(Game1 game, SceneContainer sceneContainer)
 {
     _game = game;
     AddSceneContainer(sceneContainer);
 }
Exemple #4
0
        private void AddScene(string sceneName, SceneContainer sceneContainer)
        {
            GameScene scene = new GameScene(_game, sceneContainer);

            _scenes.Add(sceneName, scene);
        }