From f803dc89dde69c64bf9c42970d67542509796a5e 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: Sun, 2 Oct 2022 17:42:23 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B4=D0=B5=D0=BB=D0=B0=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BE=D1=82=D1=80=D0=B8=D1=81=D0=BE=D0=B2=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=B0=D1=80=D1=82=D0=B8=D0=BB=D0=BB=D0=B5=D1=80=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MapWithSetArtilleriesGeneric.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/SelfPropelledArtilleryUnit/MapWithSetArtilleriesGeneric.cs b/SelfPropelledArtilleryUnit/MapWithSetArtilleriesGeneric.cs index b1cddb9..6bcce92 100644 --- a/SelfPropelledArtilleryUnit/MapWithSetArtilleriesGeneric.cs +++ b/SelfPropelledArtilleryUnit/MapWithSetArtilleriesGeneric.cs @@ -111,10 +111,17 @@ namespace Artilleries private void DrawArtilleries(Graphics g) { + int width = _pictureWidth / _placeSizeWidth; + int height = _pictureHeight / _placeSizeHeight; + for (int i = 0; i < _setArtilleries.Count; i++) { - // TODO установка позиции - _setArtilleries.Get(i)?.DrawingObject(g); + var artillery = _setArtilleries.Get(i); + if (artillery != null) + { + artillery.SetObject(i % width * _placeSizeWidth + 10, (height - 1 - i / width) * _placeSizeHeight + 10, _pictureWidth, _pictureHeight); + artillery.DrawingObject(g); + } } } }