Exemplo n.º 1
0
 private void Window_Closed(object sender, EventArgs e)
 {
     SunbirdMBGame.SaveAndSerialize();
     Config.SaveApplicationParameters(this);
     Config.SaveGameParameters(SunbirdMBGame);
     Config.Serialize();
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
        }
Exemplo n.º 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();
            }
        }