Esempio n. 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();
     }
 }
Esempio n. 2
0
 private void textBox_SimulateSeconds_TextChanged(object sender, EventArgs e)
 {
     try
     {
         _systemBodyData.SecondsSinceLastProcessToSimulate = TextConversionsHelper.ConvertTextToLong(textBox_SimulateSeconds.Text);
     }
     catch (FormatException)
     {
         textBox_SimulateSeconds.Text = _defaultSecondsForUpdate.ToString();
     }
 }
Esempio n. 3
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";
            }
        }