public void CanCreateClientGameSession() { var clientGSCandV = new GameSessionControllerAndView(null, null, null); stubGameSessionFactory.Stub(x => x.MakeClientGameSession(Arg<string>.Is.Equal(""), Arg<int>.Is.Anything)).Return(clientGSCandV); mainMenuScreen.State = MainMenuScreen.MainMenuState.Network; mainMenuScreen.OnSelectEntry(1); // Join a session selected stubScreenFactory.AssertWasCalled(x => x.MakeGameplayScreen(Arg<GameSessionControllerAndView>.Is.Equal(clientGSCandV), Arg<GameSessionControllerAndView>.Is.Null)); }
public GameplayScreen(GameSessionControllerAndView clientGameSessionCandV, GameSessionControllerAndView serverGameSessionCandV, IScreenFactory screenFactory) { _clientGameSessionController = clientGameSessionCandV.GameSessionController; _clientGameSessionView = clientGameSessionCandV.GameSessionView; if (serverGameSessionCandV != null) { _serverGameSessionController = serverGameSessionCandV.GameSessionController; _serverGameSessionView = serverGameSessionCandV.GameSessionView; } _screenFactory = screenFactory; // set the transition times TransitionOnTime = TimeSpan.FromSeconds(1.0); TransitionOffTime = TimeSpan.FromSeconds(1.0); }
public GameplayScreen MakeGameplayScreen(GameSessionControllerAndView clientGameSessionCandV, GameSessionControllerAndView serverGameSessionCandV) { GameplayScreen gameplayScreen = new GameplayScreen(clientGameSessionCandV, serverGameSessionCandV, this); _screenManager.AddScreen(gameplayScreen); return gameplayScreen; }