private void textBox_SimulateAtmPerAnnum_TextChanged(object sender, EventArgs e) { try { _capGetter.ValueToReturnForPerAnnumTerraformCapacity = TextConversionsHelper.ConvertTextToDouble(textBox_SimulateAtmPerAnnum.Text); } catch (FormatException) { textBox_SimulateAtmPerAnnum.Text = _defaultPerAnnumAtm.ToString(); } }
private void textBox_SimulateSeconds_TextChanged(object sender, EventArgs e) { try { _systemBodyData.SecondsSinceLastProcessToSimulate = TextConversionsHelper.ConvertTextToLong(textBox_SimulateSeconds.Text); } catch (FormatException) { textBox_SimulateSeconds.Text = _defaultSecondsForUpdate.ToString(); } }
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"; } }