diff --git a/AirPlaneWithRadar/AirPlaneWithRadar/MapWithSetPlainGeneric.cs b/AirPlaneWithRadar/AirPlaneWithRadar/MapWithSetPlainGeneric.cs index d636c51..0c116dc 100644 --- a/AirPlaneWithRadar/AirPlaneWithRadar/MapWithSetPlainGeneric.cs +++ b/AirPlaneWithRadar/AirPlaneWithRadar/MapWithSetPlainGeneric.cs @@ -119,7 +119,7 @@ namespace AirPlaneWithRadar int CountWidth = _pictureWidth / _placeSizeWidth; int x = _pictureWidth - _placeSizeWidth - _placeSizeWidth/2 - _placeSizeWidth / 4; - int y = (_pictureHeight - _placeSizeHeight)- _placeSizeHeight/2; + int y = _placeSizeHeight/4; for (int k = 0; k < _setPlains.Count; k++) { @@ -137,7 +137,7 @@ namespace AirPlaneWithRadar _setPlains.Get(k)?.SetObject(x, y, _pictureWidth, _pictureHeight); _setPlains.Get(k)?.DrawningObject(g); x = _pictureWidth - _placeSizeWidth - _placeSizeWidth / 2 - _placeSizeWidth / 4; - y -= _placeSizeHeight ; + y += _placeSizeHeight ; } } @@ -148,7 +148,7 @@ namespace AirPlaneWithRadar else { x = _pictureWidth - _placeSizeWidth - _placeSizeWidth / 2 - _placeSizeWidth / 4; - y -= _placeSizeHeight; + y += _placeSizeHeight; } } } diff --git a/AirPlaneWithRadar/AirPlaneWithRadar/SetPlaneGeneric.cs b/AirPlaneWithRadar/AirPlaneWithRadar/SetPlaneGeneric.cs index 03b74b3..15fd5a5 100644 --- a/AirPlaneWithRadar/AirPlaneWithRadar/SetPlaneGeneric.cs +++ b/AirPlaneWithRadar/AirPlaneWithRadar/SetPlaneGeneric.cs @@ -6,8 +6,9 @@ using System.Threading.Tasks; namespace AirPlaneWithRadar { - internal class SetPlaneGeneric + internal class SetPlaneGeneric where T : class + { private readonly T[] _places; public int Count => _places.Length; @@ -33,14 +34,14 @@ namespace AirPlaneWithRadar return -1; } - public bool Insert(T plain, int position) + public int Insert(T plain, int position) { if (position > Count || position < 0) - return false; + return -1; if (_places[position] == null) { _places[position] = plain; - return true; + return position; } else { @@ -53,11 +54,11 @@ namespace AirPlaneWithRadar _places[j] = _places[j - 1]; } _places[position] = plain; - return true; + return position; } } } - return false; + return -1; } public T Remove(int position)