This commit is contained in:
Alenka 2023-11-09 19:10:08 +04:00
parent 71fca0840e
commit 8c293b6d5c
2 changed files with 38 additions and 54 deletions

View File

@ -126,53 +126,37 @@ namespace Monorail.DrawningObjects
return; return;
} }
Pen pen = new Pen(Color.Black, 2); Pen pen = new Pen(Color.Black, 2);
//фюзеляж g.DrawEllipse(pen, _startPosX + 15, _startPosY + 5, 20, 20);
g.DrawEllipse(pen, _startPosX + 15, _startPosY + 35, 20, 20);
g.DrawRectangle(pen, _startPosX + 9, _startPosY + 15, 10, 30);
g.DrawRectangle(pen, _startPosX + 90, _startPosY + 15, 10,
30);
g.DrawRectangle(pen, _startPosX + 20, _startPosY + 4, 70, 52);
Brush br = new SolidBrush(EntityPlane.BodyColor); Brush br = new SolidBrush(EntityPlane.BodyColor);
g.FillRectangle(br, _startPosX + 20, _startPosY + 70, 140, 20); g.FillRectangle(br, _startPosX + 10, _startPosY + 15, 10, 30);
//кабина g.FillRectangle(br, _startPosX + 90, _startPosY + 15, 10, 30);
Point[] point = new Point[3]{ g.FillRectangle(br, _startPosX + 20, _startPosY + 5, 70, 50);
new Point(_startPosX + 0, _startPosY + 80), Point[] points = new Point[3];// нос лодки
new Point(_startPosX + 20, _startPosY + 70), points[0] = new Point(_startPosX + 100, _startPosY + 5);
new Point(_startPosX + 20, _startPosY + 90) points[1] = new Point(_startPosX + 100, _startPosY + 55);
}; points[2] = new Point(_startPosX + 100 + 50, _startPosY + 50 / 2);
Brush cabin = new SolidBrush(Color.LightBlue); g.FillPolygon(Brushes.Pink, points);
g.FillPolygon(cabin, point); //границы носа лодки
//границы самолета Point[] points1 = new Point[3];// нос лодки
g.DrawPolygon(pen, point); points1[0] = new Point(_startPosX + 100, _startPosY + 5);
g.DrawRectangle(pen, _startPosX + 20, _startPosY + 70, 140, 20); points1[1] = new Point(_startPosX + 100, _startPosY + 55);
//Крылья points1[2] = new Point(_startPosX + 100 + 50, _startPosY + 50 / 2);
point = new Point[4] { g.DrawPolygon(pen, points1);
new Point(_startPosX + 70, _startPosY + 70), g.FillRectangle(Brushes.Black, _startPosX + 5, _startPosY + 15, 10, 10);
new Point(_startPosX + 70, _startPosY + 0), g.FillRectangle(Brushes.Black, _startPosX + 5, _startPosY + 35, 10, 10);
new Point(_startPosX + 90, _startPosY + 0),
new Point(_startPosX + 100, _startPosY + 70) //если есть ракетные шахты, добавить условие
}; g.DrawRectangle(Pens.Black, _startPosX + 35,
g.FillPolygon(br, point); _startPosY + 23, 15, 15);
g.DrawPolygon(pen, point); g.DrawRectangle(Pens.Black, _startPosX + 50,
point = new Point[4] { _startPosY + 19, 30, 25);
new Point(_startPosX + 70, _startPosY + 90),
new Point(_startPosX + 70, _startPosY + 160),
new Point(_startPosX + 90, _startPosY + 160),
new Point(_startPosX + 100, _startPosY + 90)
};
g.FillPolygon(br, point);
g.DrawPolygon(pen, point);
point = new Point[4] {
new Point(_startPosX + 130, _startPosY + 70),
new Point(_startPosX + 130, _startPosY + 50),
new Point(_startPosX + 160, _startPosY + 30),
new Point(_startPosX + 160, _startPosY + 70)
};
g.FillPolygon(br, point);
g.DrawPolygon(pen, point);
point = new Point[4] {
new Point(_startPosX + 130, _startPosY + 90),
new Point(_startPosX + 130, _startPosY + 110),
new Point(_startPosX + 160, _startPosY + 130),
new Point(_startPosX + 160, _startPosY + 90)
};
g.FillPolygon(br, point);
g.DrawPolygon(pen, point);
} }
} }

View File

@ -25,11 +25,11 @@ namespace Monorail.Generics
/// <summary> /// <summary>
/// Размер занимаемого объектом места (ширина) /// Размер занимаемого объектом места (ширина)
/// </summary> /// </summary>
private readonly int _placeSizeWidth = 170; private readonly int _placeSizeWidth = 210;
/// <summary> /// <summary>
/// Размер занимаемого объектом места (высота) /// Размер занимаемого объектом места (высота)
/// </summary> /// </summary>
private readonly int _placeSizeHeight = 200; private readonly int _placeSizeHeight = 90;
/// <summary> /// <summary>
/// Набор объектов /// Набор объектов
/// </summary> /// </summary>
@ -105,12 +105,12 @@ namespace Monorail.Generics
for (int j = 0; j < _pictureHeight / _placeSizeHeight + for (int j = 0; j < _pictureHeight / _placeSizeHeight +
1; ++j) 1; ++j)
{//линия разметки места {//линия разметки места
g.DrawLine(pen, i * _placeSizeWidth + 10, j * g.DrawLine(pen, i * _placeSizeWidth, j *
_placeSizeHeight, i * _placeSizeWidth + _placeSizeWidth / 2 + 50, j * _placeSizeHeight, i * _placeSizeWidth + _placeSizeWidth / 2, j *
_placeSizeHeight); _placeSizeHeight);
} }
g.DrawLine(pen, i * _placeSizeWidth + 10, 0, i * g.DrawLine(pen, i * _placeSizeWidth, 0, i *
_placeSizeWidth + 10, _pictureHeight / _placeSizeHeight * _placeSizeHeight); _placeSizeWidth, _pictureHeight / _placeSizeHeight * _placeSizeHeight);
} }
} }
/// <summary> /// <summary>
@ -125,7 +125,7 @@ namespace Monorail.Generics
if (plane != null) if (plane != null)
{ {
int inRow = _pictureWidth / _placeSizeWidth; int inRow = _pictureWidth / _placeSizeWidth;
plane.SetPosition(_pictureWidth - _placeSizeWidth - (i % inRow * _placeSizeWidth) - _placeSizeHeight / 2 - 8, i / inRow * _placeSizeHeight + 20); plane.SetPosition((i % inRow) * (_placeSizeWidth) + _placeSizeWidth / 20, _placeSizeHeight * (i / inRow) + _placeSizeHeight / 20);
plane.DrawTransport(g); plane.DrawTransport(g);
} }
i++; i++;