Лабораторная работа №1 (доработки)

This commit is contained in:
Egor_Shtyrkin 2024-04-14 16:33:26 +04:00
parent 9e82cbdd7f
commit 5b52aa4e07

View File

@ -33,12 +33,12 @@ public class DrawningAircraftCarrier
/// <summary>
/// Ширина прорисовки авианосца
/// </summary>
private readonly int _drawningAircraftCarrierWidth = 150;
private readonly int _drawningAircraftCarrierWidth = 145;
/// <summary>
/// Высота прорисовки авианосца
/// </summary>
private readonly int _drawningAircraftCarrierHeight = 65;
private readonly int _drawningAircraftCarrierHeight = 55;
/// <summary>
/// Инициализация свойств
@ -186,16 +186,15 @@ public class DrawningAircraftCarrier
//границы авианосца
Point[] FramePoints = {
new Point(_startPosX.Value + 10, _startPosY.Value + 10),
new Point(_startPosX.Value + 110, _startPosY.Value + 10),
new Point(_startPosX.Value + 149, _startPosY.Value + 35),
new Point(_startPosX.Value + 110, _startPosY.Value + 60),
new Point(_startPosX.Value + 10, _startPosY.Value + 60),
new Point(_startPosX.Value + 5, _startPosY.Value),
new Point(_startPosX.Value + 105, _startPosY.Value),
new Point(_startPosX.Value + 145, _startPosY.Value + 25),
new Point(_startPosX.Value + 105, _startPosY.Value + 50),
new Point(_startPosX.Value + 5, _startPosY.Value + 50),
};
g.DrawPolygon(pen, FramePoints);
g.DrawRectangle(pen, _startPosX.Value + 5, _startPosY.Value + 15, 5, 18);
g.DrawRectangle(pen, _startPosX.Value + 5, _startPosY.Value + 37, 5, 18);
g.DrawRectangle(pen, _startPosX.Value, _startPosY.Value + 5, 5, 18);
g.DrawRectangle(pen, _startPosX.Value, _startPosY.Value + 27, 5, 18);
//корпус авианосца
Brush br = new SolidBrush(EntityAircraftCarrier.BodyColor);
@ -203,35 +202,35 @@ public class DrawningAircraftCarrier
//отсеки авианосца
Brush brGray = new SolidBrush(Color.Gray);
g.FillRectangle(brGray, _startPosX.Value + 85, _startPosY.Value + 20, 15, 30);
g.FillRectangle(brGray, _startPosX.Value + 65, _startPosY.Value + 30, 20, 10);
g.FillEllipse(brGray, _startPosX.Value + 105, _startPosY.Value + 24, 20, 20);
g.FillRectangle(brGray, _startPosX.Value + 80, _startPosY.Value + 10, 15, 30);
g.FillRectangle(brGray, _startPosX.Value + 60, _startPosY.Value + 20, 20, 10);
g.FillEllipse(brGray, _startPosX.Value + 100, _startPosY.Value + 14, 20, 20);
//выделяем рамкой отсеки авианосца
g.DrawRectangle(pen, _startPosX.Value + 85, _startPosY.Value + 20, 15, 30);
g.DrawRectangle(pen, _startPosX.Value + 65, _startPosY.Value + 30, 20, 10);
g.DrawEllipse(pen, _startPosX.Value + 105, _startPosY.Value + 24, 20, 20);
g.DrawRectangle(pen, _startPosX.Value + 80, _startPosY.Value + 10, 15, 30);
g.DrawRectangle(pen, _startPosX.Value + 60, _startPosY.Value + 20, 20, 10);
g.DrawEllipse(pen, _startPosX.Value + 100, _startPosY.Value + 14, 20, 20);
//двигатели авианосца
Brush brBlack = new SolidBrush(Color.Black);
g.FillRectangle(brBlack, _startPosX.Value + 5, _startPosY.Value + 15, 5, 18);
g.FillRectangle(brBlack, _startPosX.Value + 5, _startPosY.Value + 37, 5, 18);
g.FillRectangle(brBlack, _startPosX.Value, _startPosY.Value + 5, 5, 18);
g.FillRectangle(brBlack, _startPosX.Value, _startPosY.Value + 27, 5, 18);
//рубка управления
if (EntityAircraftCarrier.ControlRoom)
{
g.FillRectangle(additionalBrush, _startPosX.Value + 40, _startPosY.Value + 52, 15, 15);
g.FillRectangle(additionalBrush, _startPosX.Value + 70, _startPosY.Value + 52, 15, 15);
g.FillRectangle(additionalBrush, _startPosX.Value + 55, _startPosY.Value + 56, 15, 7);
g.FillRectangle(additionalBrush, _startPosX.Value + 35, _startPosY.Value + 56, 5, 7);
g.FillRectangle(additionalBrush, _startPosX.Value + 85, _startPosY.Value + 56, 5, 7);
g.DrawRectangle(pen, _startPosX.Value + 40, _startPosY.Value + 52, 15, 15);
g.DrawRectangle(pen, _startPosX.Value + 70, _startPosY.Value + 52, 15, 15);
g.DrawRectangle(pen, _startPosX.Value + 55, _startPosY.Value + 56, 15, 7);
g.DrawRectangle(pen, _startPosX.Value + 35, _startPosY.Value + 56, 5, 7);
g.DrawRectangle(pen, _startPosX.Value + 85, _startPosY.Value + 56, 5, 7);
g.DrawRectangle(pen, _startPosX.Value + 44, _startPosY.Value + 56, 7, 7);
g.DrawRectangle(pen, _startPosX.Value + 74, _startPosY.Value + 56, 7, 7);
g.FillRectangle(additionalBrush, _startPosX.Value + 35, _startPosY.Value + 42, 15, 15);
g.FillRectangle(additionalBrush, _startPosX.Value + 65, _startPosY.Value + 42, 15, 15);
g.FillRectangle(additionalBrush, _startPosX.Value + 50, _startPosY.Value + 46, 15, 7);
g.FillRectangle(additionalBrush, _startPosX.Value + 30, _startPosY.Value + 46, 5, 7);
g.FillRectangle(additionalBrush, _startPosX.Value + 80, _startPosY.Value + 46, 5, 7);
g.DrawRectangle(pen, _startPosX.Value + 35, _startPosY.Value + 42, 15, 15);
g.DrawRectangle(pen, _startPosX.Value + 65, _startPosY.Value + 42, 15, 15);
g.DrawRectangle(pen, _startPosX.Value + 50, _startPosY.Value + 46, 15, 7);
g.DrawRectangle(pen, _startPosX.Value + 30, _startPosY.Value + 46, 5, 7);
g.DrawRectangle(pen, _startPosX.Value + 80, _startPosY.Value + 46, 5, 7);
g.DrawRectangle(pen, _startPosX.Value + 39, _startPosY.Value + 46, 7, 7);
g.DrawRectangle(pen, _startPosX.Value + 69, _startPosY.Value + 46, 7, 7);
}
@ -240,14 +239,14 @@ public class DrawningAircraftCarrier
{
Point[] DeckPoint =
{
new Point(_startPosX.Value + 10, _startPosY.Value + 35),
new Point(_startPosX.Value + 10, _startPosY.Value + 55),
new Point(_startPosX.Value + 55, _startPosY.Value + 30),
new Point(_startPosX.Value + 55, _startPosY.Value + 10),
new Point(_startPosX.Value + 5, _startPosY.Value + 25),
new Point(_startPosX.Value + 5, _startPosY.Value + 45),
new Point(_startPosX.Value + 50, _startPosY.Value + 20),
new Point(_startPosX.Value + 50, _startPosY.Value),
};
g.FillPolygon(additionalBrush, DeckPoint);
g.DrawPolygon(pen, DeckPoint);
g.DrawLine(pen, _startPosX.Value + 10, _startPosY.Value + 45, _startPosX.Value + 55, _startPosY.Value + 20);
g.DrawLine(pen, _startPosX.Value + 5, _startPosY.Value + 35, _startPosX.Value + 50, _startPosY.Value + 10);
}
}
}