示例#1
0
 public StartingConditions GetResult()
 {
     return(new StartingConditions(
                NumberInput.DecodeQuantity(populationInput.Text).Value,
                (int)coloniesSelector.Value,
                NumberInput.DecodeQuantity(infrastructureInput.Text).Value,
                NewGameController.CustomStartNameKey));
 }
 public StartingConditions GetResult()
 {
     //TODO(v0.9) ignored number of buildings
     return(new StartingConditions(
                NumberInput.DecodeQuantity(populationInput.Text).Value,
                (int)coloniesSelector.Value,
                new StartingBuilding[0],
                NewGameController.CustomStartNameKey));
 }
示例#3
0
		private void capacityInput_TextChanged(object sender, EventArgs e)
		{
			var quantity = NumberInput.DecodeQuantity(this.capacityInput.Text);
			if (quantity.HasValue && quantity.Value < 0)
				quantity = null;

			if (quantity.HasValue)
			{
				this.controller.TargetTransportCapacity = quantity.Value;
				this.capacityInput.BackColor = SystemColors.Window;
			}
			else
				this.capacityInput.BackColor = Color.LightPink;
		}
示例#4
0
        private void quantityInput_TextChanged(object sender, EventArgs e)
        {
            if (ignoreEvents)
            {
                return;
            }

            ignoreEvents = true;

            var quantity = NumberInput.DecodeQuantity(quantityInput.Text);

            if (quantity.HasValue && (quantity.Value < 0 || quantity.Value > maximum))
            {
                quantity = null;
            }

            quantityInput.BackColor = quantity.HasValue ? validColor : invalidColor;
            if (quantity.HasValue)
            {
                this.quantitySlider.Value = (int)((quantity.Value / (double)maximum) * this.quantitySlider.Maximum);
            }
            ignoreEvents = false;
        }
示例#5
0
 private void infrastructureInput_TextChanged(object sender, EventArgs e)
 {
     infrastructureInput.BackColor = NumberInput.DecodeQuantity(infrastructureInput.Text) != null ? validColor : invalidColor;
 }
示例#6
0
 private void populationInput_TextChanged(object sender, EventArgs e)
 {
     populationInput.BackColor = NumberInput.DecodeQuantity(populationInput.Text) != null ? validColor : invalidColor;
 }