Beispiel #1
0
 private void textBox_SimulateAtmPerAnnum_TextChanged(object sender, EventArgs e)
 {
     try
     {
         _capGetter.ValueToReturnForPerAnnumTerraformCapacity = TextConversionsHelper.ConvertTextToDouble(textBox_SimulateAtmPerAnnum.Text);
     }
     catch (FormatException)
     {
         textBox_SimulateAtmPerAnnum.Text = _defaultPerAnnumAtm.ToString();
     }
 }
Beispiel #2
0
        private void button_SetTarget_Click(object sender, EventArgs e)
        {
            try
            {
                var targetAmount = TextConversionsHelper.ConvertTextToDouble(textBox_TargetAmount.Text);
                var targetId     = GetSelectedTargetElementFromComboBox();
                if (targetId.HasValue == false)
                {
                    return;
                }

                _terraformGameState.SetTargetFor(_systemBodyId, _populationId, targetId.Value, targetAmount);
                _systemBodyData.CurrentPopulationTerraformTargets = _terraformGameState.GetTargetsForAll();
                UpdateTargetList();
            }
            catch (FormatException)
            {
                textBox_TargetAmount.Text = "0.0";
            }
        }