/// <summary> /// Constructor. /// </summary> /// <param name="engine">The <see cref="EnginePivot"/>.</param> public CityNameWindow(EnginePivot engine) { InitializeComponent(); _engine = engine; City = null; TextBoxCityName.Text = _engine.HumanPlayer.GetNextCityName; }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { var res = MessageBox.Show("Save the game ?", "ErsatzCiv", MessageBoxButton.YesNoCancel); if (res == MessageBoxResult.Yes) { var serRes = EnginePivot.SerializeToFile(_engine, Settings.Default.datasPath + Settings.Default.savesSubFolder); if (!string.IsNullOrWhiteSpace(serRes)) { MessageBox.Show($"Save has failed with the following error : {serRes}", "ErsatzCiv"); e.Cancel = true; } else { MessageBox.Show("Save done !", "ErsatzCiv"); // Quit hard. Environment.Exit(0); } } else if (res == MessageBoxResult.Cancel) { e.Cancel = true; } else { // Quit hard. Environment.Exit(0); } }
public WindowAdvancePick(EnginePivot engine) { InitializeComponent(); _engine = engine; ComboBoxAdvancePick.ItemsSource = _engine.HumanPlayer.GetAvailableAdvances(); ComboBoxAdvancePick.SelectedItem = _engine.HumanPlayer.CurrentAdvance; ComboBoxEra.ItemsSource = Enum.GetValues(typeof(EraPivot)); }
public MainWindow(EnginePivot engine) { InitializeComponent(); ExpanderMenu.ExpandDirection = ExpandDirection.Up; _engine = engine; CheckBoxWaitTurn.IsChecked = Settings.Default.waitEndTurn; InitializeEngineEvents(); DrawFullMapAndMiniMap(); RefreshDynamicView(); SliderScienceRate.Value = _engine.HumanPlayer.ScienceRate; SliderLuxuryRate.Value = _engine.HumanPlayer.LuxuryRate; RefreshRateLabels(); }
/// <summary> /// Constructor. /// </summary> /// <param name="engine">The <see cref="EnginePivot"/>.</param> /// <param name="city">The <see cref="CityPivot"/> to manage.</param> public CityWindow(EnginePivot engine, CityPivot city) { InitializeComponent(); for (int i = 0; i < COUNT_SHOW_CITY_SQUARES; i++) { GridCityMap.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(CITY_GRID_SIZE) }); GridCityMap.RowDefinitions.Add(new RowDefinition { Height = new GridLength(CITY_GRID_SIZE) }); } _engine = engine; _city = city; RefreshDisplay(); }
public WindowRegimePick(EnginePivot engine) { InitializeComponent(); _engine = engine; ComboBoxRegimes.ItemsSource = _engine.HumanPlayer.GetAvailableRegimes(); }