Точно итоговый вариант 3 лабораторной

This commit is contained in:
AnnZhimol 2022-10-05 10:27:49 +04:00
parent 26b48afac4
commit f8520664cc

View File

@ -29,7 +29,13 @@ namespace Warship
private void ButtonCreate_Click(object sender, EventArgs e)
{
Random rnd = new();
_warship = new DrawingWarship(rnd.Next(10, 60), rnd.Next(20000, 25000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));
Color color = Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256));
ColorDialog dialog = new();
if (dialog.ShowDialog() == DialogResult.OK)
{
color = dialog.Color;
}
_warship = new DrawingWarship(rnd.Next(10, 60), rnd.Next(20000, 25000),color);
SetData();
Draw();
}
@ -63,7 +69,19 @@ namespace Warship
private void ButtonCreateModif_Click(object sender, EventArgs e)
{
Random rnd = new();
_warship = new DrawingAdvancedWarship(rnd.Next(10, 60), rnd.Next(20000, 25000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)), Convert.ToBoolean(rnd.Next(0,2)), Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0, 2)));
Color color1 = Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256));
ColorDialog dialog1 = new();
if (dialog1.ShowDialog() == DialogResult.OK)
{
color1 = dialog1.Color;
}
Color color2 = Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256));
ColorDialog dialog2 = new();
if (dialog2.ShowDialog() == DialogResult.OK)
{
color2 = dialog2.Color;
}
_warship = new DrawingAdvancedWarship(rnd.Next(10, 60), rnd.Next(20000, 25000), color1,color2, Convert.ToBoolean(rnd.Next(0,2)), Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0, 2)));
SetData();
Draw();
}