private void Window_Closed(object sender, EventArgs e) { SunbirdMBGame.SaveAndSerialize(); Config.SaveApplicationParameters(this); Config.SaveGameParameters(SunbirdMBGame); Config.Serialize(); }
private void ResizeGameWindow() { // Set back buffer size to panel size. SunbirdMBWindowViewModel.GameWidth = (int)MainGamePanel.ActualWidth; SunbirdMBWindowViewModel.GameHeight = (int)MainGamePanel.ActualHeight; // Reposition camera. SunbirdMBGame.SetCameraTransformMatrix((int)MainGamePanel.ActualWidth, (int)MainGamePanel.ActualHeight); }
public SunbirdMBWindowViewModel(SunbirdMBGame sunbirdMBGame) { SunbirdMBGame = sunbirdMBGame; C_Sort = new RelayCommand((o) => SortCubes()); C_Save = new RelayCommand((o) => SaveGame()); C_Exit = new RelayCommand((o) => ExitAppWithoutSaving()); CubeDesignerViewModel = new CubeDesignerViewModel(sunbirdMBGame); decoCatalogViewModel = new DecoCatalogViewModel(sunbirdMBGame); LoggerViewModel = new LoggerViewModel(); MainToolbarViewModel = new MainToolbarViewModel(this); }
public MapBuilder(SunbirdMBGame mainGame, string path) : base(mainGame) { SunbirdMBGame = mainGame; this.saveFilePath = path; var sfp = Path.Combine(UriHelper.AppDirectory, path); Debug.Assert(sfp == @"D:\SunbirdMB\bin\Debug\MapBuilderSave.xml"); if (mainGame.cleanLoad || !File.Exists(sfp)) { CreateContent(); } else { LoadContentFromFile(); } }