From 4a1039d391b41d8e7c558da8b1dd4307c3f4fae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=A7=D0=B5=D0=B3=D0=BE=D0=B4=D0=B0=D0=B5=D0=B2?= Date: Wed, 13 Dec 2023 23:10:44 +0400 Subject: [PATCH] lab1 --- Cruiser/Cruiser/DrawningCruiser.cs | 17 +---------------- Cruiser/Cruiser/EntityCruiser.cs | 2 -- Cruiser/Cruiser/FormCruiser.cs | 3 +-- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/Cruiser/Cruiser/DrawningCruiser.cs b/Cruiser/Cruiser/DrawningCruiser.cs index 2e61a25..fb5d921 100644 --- a/Cruiser/Cruiser/DrawningCruiser.cs +++ b/Cruiser/Cruiser/DrawningCruiser.cs @@ -9,7 +9,6 @@ namespace Cruiser { internal class DrawningCruiser { - public EntityCruiser? EntityCruiser { get; private set; } private int _pictureWidth; @@ -56,7 +55,6 @@ additionalColor, bool vert, bool rocket, int width, int height) } switch (direction) { - case DirectionType.Left: if (_startPosX - EntityCruiser.Step > 0) { @@ -88,7 +86,6 @@ additionalColor, bool vert, bool rocket, int width, int height) { _startPosX += _pictureWidth - _startPosX - _cruiserWidth; } - break; case DirectionType.Down: @@ -114,10 +111,6 @@ additionalColor, bool vert, bool rocket, int width, int height) Brush additionalBrush = new SolidBrush(EntityCruiser.AdditionalColor); Brush BodyColor = new SolidBrush(EntityCruiser.BodyColor); - - - - GraphicsPath path1 = new GraphicsPath(); path1.AddLine(_startPosX + 100, _startPosY + 0, _startPosX + 0, _startPosY + 0); path1.AddLine(_startPosX + 0, _startPosY + 50, _startPosX + 0, _startPosY + 0); @@ -128,32 +121,27 @@ additionalColor, bool vert, bool rocket, int width, int height) g.FillPath(additionalBrush, path1); g.DrawPath(pen, path1); - Brush brBlack = new SolidBrush(Color.Black); g.DrawRectangle(pen, _startPosX - 3, _startPosY + 7, 3, 15); g.FillRectangle(brBlack, _startPosX - 3, _startPosY + 7, 3, 15); g.DrawRectangle(pen, _startPosX - 3, _startPosY + 25, 3, 15); g.FillRectangle(brBlack, _startPosX - 3, _startPosY + 25, 3, 15); - g.DrawRectangle(pen, _startPosX + 60, _startPosY + 12, 20, 25); g.FillRectangle(brBlack, _startPosX + 60, _startPosY + 12, 20, 25); g.DrawRectangle(pen, _startPosX + 30, _startPosY + 19, 30, 13); g.FillRectangle(brBlack, _startPosX + 30, _startPosY + 19, 30, 13); - if (EntityCruiser.Vert) { - Brush brRed = new SolidBrush(Color.Red); g.FillEllipse(brRed, _startPosX + 95, _startPosY + 15, 20, 20); g.DrawEllipse(pen, _startPosX + 95, _startPosY + 15, 20, 20); } + if (EntityCruiser.Rocket) { - - g.DrawEllipse(pen, _startPosX + 8, _startPosY + 3, 15, 12); g.FillEllipse(brBlack, _startPosX + 8, _startPosY + 3, 15, 12); @@ -162,11 +150,8 @@ additionalColor, bool vert, bool rocket, int width, int height) g.DrawEllipse(pen, _startPosX + 8, _startPosY + 33, 15, 12); g.FillEllipse(brBlack, _startPosX + 8, _startPosY + 33, 15, 12); - } - } - } } diff --git a/Cruiser/Cruiser/EntityCruiser.cs b/Cruiser/Cruiser/EntityCruiser.cs index 4c94386..3971b80 100644 --- a/Cruiser/Cruiser/EntityCruiser.cs +++ b/Cruiser/Cruiser/EntityCruiser.cs @@ -8,7 +8,6 @@ namespace Cruiser { internal class EntityCruiser { - public int Speed { get; private set; } public double Weight { get; private set; } @@ -17,7 +16,6 @@ namespace Cruiser public Color AdditionalColor { get; private set; } - public bool Vert { get; private set; } public bool Rocket { get; private set; } diff --git a/Cruiser/Cruiser/FormCruiser.cs b/Cruiser/Cruiser/FormCruiser.cs index c24a4bf..0cee200 100644 --- a/Cruiser/Cruiser/FormCruiser.cs +++ b/Cruiser/Cruiser/FormCruiser.cs @@ -4,14 +4,13 @@ namespace Cruiser { public partial class FormCruiser : Form { - private DrawningCruiser? _drawningCruiser; public FormCruiser() { InitializeComponent(); } - + private void Draw() { if (_drawningCruiser == null)