public void SelectDefaultScene_GivenRegistryWithNoReservedNames_ReturnsFirstEntry() { var registry = new SceneRouteTable(); registry.Scenes.Add(typeof(TestScene)); registry.Scenes.Add(typeof(RandomScene)); var start = new DefaultSceneSelectionStrategy().SelectStartScene(registry); Assert.That(start, Is.EqualTo("TestScene")); }
public GameVc(Game theGame, string contentDirectory = "Content") { _theGame = theGame; _theGame.Content.RootDirectory = contentDirectory; _renderingContext = new RenderingContext { Game = _theGame, GraphicsDevice = new GraphicsDeviceManager(theGame)}; DependencyResolver = new ActivationShim(Activator.CreateInstance); SceneRouteTable = new SceneRouteTable(); SceneRegistrar = new SceneRegistrar(SceneRouteTable); Router = new SceneRouter(SceneRouteTable, new SceneCache(DependencyResolver.CreateInstance)); _gameLoop = new GameLoop(theGame, Router, t => CurrentScene.PreUpdate(), t => CurrentScene.Update(t), t => CurrentScene.PostUpdate() ); }
public string SelectStartScene(SceneRouteTable routeTable) { return SelectStartScene(routeTable.Scenes.Select(x => x.Name).ToArray()); }