コード例 #1
0
        private void Okay_Click(object sender, RoutedEventArgs e)
        {
            // Activate the main window for use
            Application.Current.MainWindow.Activate();
            Application.Current.MainWindow.Focusable = true;
            Application.Current.MainWindow.IsEnabled = true;

            // Set the actual data store on the main class for later use (saving)
            LevelEditor.GeneralGameProperties prop = new GeneralGameProperties();
            prop.lives           = (int)_Lives.Value;
            prop.health          = (int)_Health.Value;
            prop.damageSpikes    = (int)_DamageSpikes.Value;
            prop.damageSawBot    = (int)_DamageSawBots.Value;
            prop.damageTurretBot = (int)_DamageTurretBots.Value;
            prop.timer           = (int)_Timer.Value;

            ((MainWindow)System.Windows.Application.Current.MainWindow).SetGeneralGameProperties(prop);

            // Close general window (as done with it)
            this.Visibility = Visibility.Hidden;
        }
コード例 #2
0
 // Setters
 public void SetGeneralGameProperties(GeneralGameProperties val)
 {
     _level.generalGameProperties = val;
 }