/// <summary> /// Makes the user exit the game with a clear result. /// </summary> public void ExitGameToResult() { var record = currentParameter.Record ?? lastRecord; var screen = ScreenNavigator.Show <ResultScreen>(); screen.Model.Setup(currentParameter.Map, record); }
/// <summary> /// Navigates away toward game screen. /// </summary> public void NavigateToGame() { ScreenNavigator.Hide <PrepareScreen>(); OverlayNavigator.Show <GameLoadOverlay>().Model.StartLoad(new GameParameter() { Map = SelectedMap.Value, }); }
/// <summary> /// Re-enters the game to retry. /// </summary> public void Retry() { ScreenNavigator.Hide <ResultScreen>(); OverlayNavigator.Show <GameLoadOverlay>().Model.StartLoad(new GameParameter() { Map = Map.Value, }); }
/// <summary> /// Starts loading a new game session instance. /// </summary> public void StartLoad(GameParameter parameter) { var gameScreen = ScreenNavigator.CreateHidden <GameScreen>(); var selectedMap = SelectedMap.Value; var modeServicer = ModeManager.GetService(selectedMap.PlayableMode); loadingState.BindTo(GameModel.LoadState); // Start loading the game. GameModel.LoadGame(parameter, modeServicer); // Listen to game screen init event. GameModel.LoadState.BindAndTrigger(OnLoadStateChange); }
/// <summary> /// Starts replay of this result. /// </summary> public void Replay() { var replayFile = RecordStore.GetReplayFile(record.Value); if (replayFile != null && replayFile.Exists) { ScreenNavigator.Hide <ResultScreen>(); OverlayNavigator.Show <GameLoadOverlay>().Model.StartLoad(new GameParameter() { Map = Map.Value, ReplayFile = replayFile, Record = record.Value, }); } }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // Initialization logic here screenFactory = new ScreenFactory(); applicationAdapter = new MonoGameApplicationAdapter(this); screenNavigator = new ScreenNavigator(screenFactory, applicationAdapter); inputAdapter = new MonoGameInputAdapter(); onClickVisitor = new OnClickVisitor(inputAdapter); updateVisitor = new DefaultUpdateVisitor(inputAdapter); // Configuration this.IsMouseVisible = true; // base.Initialize(); }
/// <summary> /// Makes the user exit the game back to preparation screen. /// </summary> public void ExitGameForceful() => ScreenNavigator.Show <PrepareScreen>();
public ApplicationController(SignalBus signalBus, ScreenNavigator screenNavigator) { _signalBus = signalBus; _screenNavigator = screenNavigator; }
/// <summary> /// Attempts to navigate to download screen. /// </summary> public void DownloadMaps() { ScreenNavigator.Show <DownloadScreen>(); HideMenu(); }
/// <summary> /// Attempts to navigate to songs selection screen for play. /// </summary> public void PlayGame() { ScreenNavigator.Show <SongsScreen>(); HideMenu(); }
/// <summary> /// Navigates away to the next view. /// </summary> public void NavigateToNext() { OverlayNavigator.Show <SystemOverlay>(); OverlayNavigator.Show <BackgroundOverlay>(); ScreenNavigator.Show <HomeScreen>(); }
/// <summary> /// Navigates to the next specified screen. /// </summary> private void NavigateToScreen <T>() where T : MonoBehaviour, INavigationView { ScreenNavigator.Show <T>(); OverlayNavigator.Hide <GameLoadOverlay>(); }
/// <summary> /// Navigates away to the results screen to view the specified record. /// </summary> public void NavigateToResults(IRecord record) { var resultScreen = ScreenNavigator.Show <ResultScreen>(); resultScreen.Model.Setup(SelectedMap.Value, record, allowRetry: false); }
/// <summary> /// Navigates back to songs screen. /// </summary> public void NavigateToSongs() => ScreenNavigator.Show <SongsScreen>();
/// <summary> /// Navigates back to prepare screen. /// </summary> public void ToPrepare() => ScreenNavigator.Show <PrepareScreen>();