From 28e4d143c33170057080865009becdb503ec9f88 Mon Sep 17 00:00:00 2001 From: F1rsTTeaM Date: Wed, 6 Mar 2024 16:28:03 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=20BodyColor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Drawnings/DrawingAirplaneWithRadar.cs | 32 ++++++++----------- .../Drawnings/DrawningAirplane.cs | 29 +++++++++-------- .../Entities/EntityAirplaneWithRadar.cs | 8 ++--- 3 files changed, 33 insertions(+), 36 deletions(-) diff --git a/AirplaneWithRadar/ProjectAirplaneWithRadar/Drawnings/DrawingAirplaneWithRadar.cs b/AirplaneWithRadar/ProjectAirplaneWithRadar/Drawnings/DrawingAirplaneWithRadar.cs index d410403..1e97679 100644 --- a/AirplaneWithRadar/ProjectAirplaneWithRadar/Drawnings/DrawingAirplaneWithRadar.cs +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/Drawnings/DrawingAirplaneWithRadar.cs @@ -15,10 +15,10 @@ namespace ProjectAirplaneWithRadar.Drawnings /// Основной цвет /// Дополнительный цвет /// Шасси - /// Ракета - public DrawingAirplaneWithRadar(int speed, double weight, Color bodyColor, Color additionalColor, bool wheels, bool rocket) : base(150, 93) + /// Радар + public DrawingAirplaneWithRadar(int speed, double weight, Color bodyColor, Color additionalColor, bool wheels, bool radar) : base(150, 93) { - EntityAirplane = new EntityAirplaneWithRadar(speed, weight, bodyColor, additionalColor, wheels, rocket); + EntityAirplane = new EntityAirplaneWithRadar(speed, weight, bodyColor, additionalColor, wheels, radar); } public override void DrawTransport(Graphics g) @@ -45,31 +45,27 @@ namespace ProjectAirplaneWithRadar.Drawnings //Передняя стойка g.DrawRectangle(pen, _startPosX.Value + 95, _startPosY.Value + 80, 5, 10); - g.FillRectangle(additionalBrush, _startPosX.Value + 95, _startPosY.Value + 80, 5, 10); + g.FillRectangle(additionalBrush, _startPosX.Value + 95, _startPosY.Value +80, 5, 10); g.DrawEllipse(pen, _startPosX.Value + 92, _startPosY.Value + 85, 10, 10); g.FillEllipse(additionalBrush, _startPosX.Value + 92, _startPosY.Value + 85, 10, 10); } - //_startPosY += 10; + _startPosY += 10; base.DrawTransport(g); - //_startPosY -= 10; + _startPosY -= 10; - //Ракета воздух-воздух - if (airplaneWithRadar.Rocket) + //Радар + if (airplaneWithRadar.Radar) { - g.DrawRectangle(pen, _startPosX.Value + 50, _startPosY.Value + 70, 2, 5); - g.FillRectangle(additionalBrush, _startPosX.Value + 50, _startPosY.Value + 70, 2, 5); + g.DrawRectangle(pen, _startPosX.Value + 70, _startPosY.Value + 40, 10, 10); + g.FillRectangle(additionalBrush, _startPosX.Value + 70, _startPosY.Value + 40, 10, 10); - g.DrawRectangle(pen, _startPosX.Value + 80, _startPosY.Value + 70, 2, 5); - g.FillRectangle(additionalBrush, _startPosX.Value + 80, _startPosY.Value + 70, 2, 5); + g.DrawEllipse(pen, _startPosX.Value + 50, _startPosY.Value + 30, 50, 10); + g.FillEllipse(additionalBrush, _startPosX.Value + 50, _startPosY.Value + 30, 50, 10); + } - g.DrawRectangle(pen, _startPosX.Value + 40, _startPosY.Value + 75, 50, 5); - g.FillRectangle(additionalBrush, _startPosX.Value + 40, _startPosY.Value + 75, 50, 5); - } - - - } + } } } diff --git a/AirplaneWithRadar/ProjectAirplaneWithRadar/Drawnings/DrawningAirplane.cs b/AirplaneWithRadar/ProjectAirplaneWithRadar/Drawnings/DrawningAirplane.cs index 14607f3..ca52982 100644 --- a/AirplaneWithRadar/ProjectAirplaneWithRadar/Drawnings/DrawningAirplane.cs +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/Drawnings/DrawningAirplane.cs @@ -228,40 +228,41 @@ namespace ProjectAirplaneWithRadar.Drawnings Pen pen = new(Color.Black); + //Корпус - g.DrawRectangle(pen, _startPosX.Value + 10, _startPosY.Value + 50, 100, 30); + g.DrawRectangle(pen, _startPosX.Value + 10, _startPosY.Value + 40, 100, 30); //Хвост Point[] points = { new Point(_startPosX.Value + 10, _startPosY.Value), - new Point(_startPosX.Value + 10, _startPosY.Value + 50), - new Point(_startPosX.Value + 50, _startPosY.Value + 50) + new Point(_startPosX.Value + 10, _startPosY.Value + 40), + new Point(_startPosX.Value + 50, _startPosY.Value + 40) }; g.DrawPolygon(pen, points); //Кабина Point[] points2 = { - new Point(_startPosX.Value + 110, _startPosY.Value + 45), - new Point(_startPosX.Value + 110, _startPosY.Value + 65), - new Point(_startPosX.Value + 150, _startPosY.Value + 65) + new Point(_startPosX.Value + 110, _startPosY.Value + 35), + new Point(_startPosX.Value + 110, _startPosY.Value + 55), + new Point(_startPosX.Value + 150, _startPosY.Value + 55) }; g.DrawPolygon(pen, points2); Point[] points3 = { - new Point(_startPosX.Value + 110, _startPosY.Value + 65), - new Point(_startPosX.Value + 110, _startPosY.Value + 85), - new Point(_startPosX.Value + 150, _startPosY.Value + 65) + new Point(_startPosX.Value + 110, _startPosY.Value + 55), + new Point(_startPosX.Value + 110, _startPosY.Value + 75), + new Point(_startPosX.Value + 150, _startPosY.Value + 55) }; g.DrawPolygon(pen, points3); //Крыло - Brush brBlack = new SolidBrush(Color.Black); - g.DrawEllipse(pen, _startPosX.Value + 30, _startPosY.Value + 60, 70, 10); - g.FillEllipse(brBlack, _startPosX.Value + 30, _startPosY.Value + 60, 70, 10); + Brush brBlack = new SolidBrush(EntityAirplane.BodyColor); + g.DrawEllipse(pen, _startPosX.Value + 30, _startPosY.Value + 50, 70, 10); + g.FillEllipse(brBlack, _startPosX.Value + 30, _startPosY.Value + 50, 70, 10); //Хвостовой элерон - g.DrawEllipse(pen, _startPosX.Value, _startPosY.Value + 45, 30, 10); - g.FillEllipse(brBlack, _startPosX.Value, _startPosY.Value + 45, 30, 10); + g.DrawEllipse(pen, _startPosX.Value, _startPosY.Value + 35, 30, 10); + g.FillEllipse(brBlack, _startPosX.Value, _startPosY.Value + 35, 30, 10); } } diff --git a/AirplaneWithRadar/ProjectAirplaneWithRadar/Entities/EntityAirplaneWithRadar.cs b/AirplaneWithRadar/ProjectAirplaneWithRadar/Entities/EntityAirplaneWithRadar.cs index e6d802a..ff6d5e8 100644 --- a/AirplaneWithRadar/ProjectAirplaneWithRadar/Entities/EntityAirplaneWithRadar.cs +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/Entities/EntityAirplaneWithRadar.cs @@ -18,7 +18,7 @@ /// /// Признак (опция) наличия ракеты /// - public bool Rocket { get; private set; } + public bool Radar { get; private set; } /// /// Шаг перемещения автомобиля @@ -33,12 +33,12 @@ /// Основной цвет /// Дополнительный цвет /// Шасси - /// Ракета - public EntityAirplaneWithRadar(int speed, double weight, Color bodyColor, Color additionalColor, bool wheels, bool rocket) : base(speed, weight, bodyColor) + /// Радар + public EntityAirplaneWithRadar(int speed, double weight, Color bodyColor, Color additionalColor, bool wheels, bool radar) : base(speed, weight, bodyColor) { AdditionalColor = additionalColor; Wheels = wheels; - Rocket = rocket; + Radar = radar; } } }