예제 #1
0
 private void Window_Closed(object sender, EventArgs e)
 {
     SunbirdMBGame.SaveAndSerialize();
     Config.SaveApplicationParameters(this);
     Config.SaveGameParameters(SunbirdMBGame);
     Config.Serialize();
 }
예제 #2
0
 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);
 }
예제 #3
0
        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);
        }
예제 #4
0
        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();
            }
        }