diff --git a/DoubleDeckerBus_Hard/DoubleDeckerBus_Hard/DoubleDeckerBus.cs b/DoubleDeckerBus_Hard/DoubleDeckerBus_Hard/DoubleDeckerBus.cs index 5ee08b2..bd5c338 100644 --- a/DoubleDeckerBus_Hard/DoubleDeckerBus_Hard/DoubleDeckerBus.cs +++ b/DoubleDeckerBus_Hard/DoubleDeckerBus_Hard/DoubleDeckerBus.cs @@ -26,14 +26,7 @@ namespace DoubleDeckerBus_Hard private void buttonCreateBus_Click(object sender, EventArgs e) { Random random = new(); - Color color = Color.FromArgb(random.Next(0, 256), - random.Next(0, 256), random.Next(0, 256)); - ColorDialog dialog = new(); - if (dialog.ShowDialog() == DialogResult.OK) - { - color = dialog.Color; - } - _drawningBus = new DrawningBus(random.Next(100, 300),random.Next(1000, 3000), color, + _drawningBus = new DrawningBus(random.Next(100, 300),random.Next(1000, 3000), Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)), pictureBoxBus.Width, pictureBoxBus.Height, random.Next(2, 6), random.Next(0, 4)); _drawningBus.SetPosition(random.Next(10, 100), random.Next(10,100)); Draw(); @@ -42,21 +35,8 @@ namespace DoubleDeckerBus_Hard private void buttonCreatDoubleDeckerBus_Click(object sender, EventArgs e) { Random random = new(); - Color color = Color.FromArgb(random.Next(0, 256), - random.Next(0, 256), random.Next(0, 256)); - ColorDialog dialogColor = new(); - if (dialogColor.ShowDialog() == DialogResult.OK) - { - color = dialogColor.Color; - } - Color dopColor = Color.FromArgb(random.Next(0, 256), - random.Next(0, 256), random.Next(0, 256)); - ColorDialog dialogDopColor = new(); - if (dialogDopColor.ShowDialog() == DialogResult.OK) - { - dopColor = dialogDopColor.Color; - } - _drawningBus = new DrawningDoubleDeckerBus(random.Next(100, 300), random.Next(1000, 3000), color, dopColor, + _drawningBus = new DrawningDoubleDeckerBus(random.Next(100, 300), random.Next(1000, 3000), Color.FromArgb(random.Next(0, 256), random.Next(0, 256), + random.Next(0, 256)), Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)), Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)), random.Next(2, 6), Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)), pictureBoxBus.Width, pictureBoxBus.Height, random.Next(0, 4)); _drawningBus.SetPosition(random.Next(10, 100), random.Next(10, 100));