Sorokin P.V. Lab work 2 #2

Merged
eegov merged 7 commits from LabWork02 into LabWork01 2022-09-30 10:31:11 +04:00
Showing only changes of commit eb6e8d6cce - Show all commits

View File

@ -24,24 +24,8 @@ namespace Liner
toolStripStatusLabelSpeed.Text = $"Скорость: {ship.Ship.Speed}";
toolStripStatusLabelWeight.Text = $"Вес: {ship.Ship.Weight}";
toolStripStatusLabelBodyColor.Text = $"Цвет: {ship.Ship.BodyColor.Name}";
if (comboBoxSelectorMap.Text == "Простая карта")
{
pictureBoxShip.Image = _abstractMap.CreateMap(pictureBoxShip.Width, pictureBoxShip.Height, new DrawingObjectShip(ship));
new DrawingObjectShip(ship);
}
if (comboBoxSelectorMap.Text == "Море и айсберги")
{
pictureBoxShip.Image = _abstractMap.CreateMap(pictureBoxShip.Width, pictureBoxShip.Height, new DrawingObjectShip(ship));
new DrawingObjectShip(ship);
}
if (comboBoxSelectorMap.Text == "Болото")
{
pictureBoxShip.Image = _abstractMap.CreateMap(pictureBoxShip.Width, pictureBoxShip.Height, new DrawingObjectShip(ship));
new DrawingObjectShip(ship);
}
pictureBoxShip.Image = _abstractMap.CreateMap(pictureBoxShip.Width, pictureBoxShip.Height, new DrawingObjectShip(ship));
new DrawingObjectShip(ship);
}
Review

Много пустых строк

Много пустых строк
@ -55,7 +39,6 @@ namespace Liner
}
private void ButtonMove_Click(object sender, EventArgs e)
{
//получаем имя кнопки
string name = ((Button)sender)?.Name ?? string.Empty;
Direction dir = Direction.None;
switch (name)
@ -73,19 +56,7 @@ namespace Liner
dir = Direction.Right;
break;
}
if (comboBoxSelectorMap.Text == "Простая карта")
{
pictureBoxShip.Image = _abstractMap?.MoveObject(dir);
}
if (comboBoxSelectorMap.Text == "Море и айсберги")
{
pictureBoxShip.Image = _abstractMap?.MoveObject(dir);
}
if (comboBoxSelectorMap.Text == "Болото")
{
pictureBoxShip.Image = _abstractMap?.MoveObject(dir);
}
pictureBoxShip.Image = _abstractMap?.MoveObject(dir);
}
private void ButtonCreateModif_Click(object sender, EventArgs e)