Esempio n. 1
0
        public void AddSceneContainer(SceneContainer sceneContainer)
        {
            _sceneContainer = sceneContainer;

            if (!_game.Components.Contains(sceneContainer))
            {
                _game.Components.Add(sceneContainer);
            }
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public GameScene(Game1 game, SceneContainer sceneContainer)
 {
     _game = game;
     AddSceneContainer(sceneContainer);
 }
Esempio n. 4
0
        private void AddScene(string sceneName, SceneContainer sceneContainer)
        {
            GameScene scene = new GameScene(_game, sceneContainer);

            _scenes.Add(sceneName, scene);
        }