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) {