From fbd570c22dbfcbca8fb56cfab895697ca143764e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9F=D0=BE=D0=BB?= =?UTF-8?q?=D0=B5=D0=B2=D0=BE=D0=B9?= Date: Mon, 26 Sep 2022 18:36:46 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=BB=D0=B5=D0=BD=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8=D1=82=D0=B5=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D1=8B=D0=B9=20=D0=BA=D0=BE=D0=BD=D1=81=D1=82=D1=80?= =?UTF-8?q?=D1=83=D0=BA=D1=82=D0=BE=D1=80=20=D0=B8=20=D0=BC=D0=B5=D1=82?= =?UTF-8?q?=D0=BE=D0=B4=20=D1=81=D1=82=D0=B0=D0=BB=20virtual?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SelfPropelledArtilleryUnit/DrawingArtillery.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SelfPropelledArtilleryUnit/DrawingArtillery.cs b/SelfPropelledArtilleryUnit/DrawingArtillery.cs index 38abc72..0ef8ae4 100644 --- a/SelfPropelledArtilleryUnit/DrawingArtillery.cs +++ b/SelfPropelledArtilleryUnit/DrawingArtillery.cs @@ -15,10 +15,18 @@ namespace Artilleries private int? _pictureHeight = null; private readonly int _artilleryWidth = 80; private readonly int _artilleryHeight = 50; + public DrawingArtillery(int speed, float weight, Color bodyColor) { Artillery = new EntityArtillery(speed, weight, bodyColor); } + + protected DrawingArtillery(int speed, float weight, Color bodyColor, int artilleryWidth, int artilleryHeight) : this(speed, weight, bodyColor) + { + _artilleryWidth = artilleryWidth; + _artilleryHeight = artilleryHeight; + } + public void SetPosition(int x, int y, int width, int height) { if (x < 0 || x + _artilleryWidth >= width) @@ -73,7 +81,7 @@ namespace Artilleries } } - public void DrawTransport(Graphics g) + public virtual void DrawTransport(Graphics g) { if (_startPosX < 0 || _startPosY < 0 || !_pictureHeight.HasValue || !_pictureWidth.HasValue) {