diff --git a/ProjectPlane/ProjectPlane/AirfieldMap.cs b/ProjectPlane/ProjectPlane/AirfieldMap.cs deleted file mode 100644 index 2eeb115..0000000 --- a/ProjectPlane/ProjectPlane/AirfieldMap.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ProjectPlane -{ - internal class AirfieldMap : AbstractMap - { - /// - /// Цвет участка закрытого - /// - private readonly Brush barrierColor = new SolidBrush(Color.Black); - private readonly Brush lineColor = new SolidBrush(Color.Yellow); - /// - /// Цвет участка открытого - /// - private readonly Brush roadColor = new SolidBrush(Color.Gray); - - protected override void DrawBarrierPart(Graphics g, int i, int j) - { - Point[] Triangle = new Point[3]; - Triangle[0].X = i * (int)_size_x; Triangle[0].Y = j * (int)_size_y; - Triangle[1].X = i * (int)_size_x + 8; Triangle[1].Y = j * (int)_size_y - 5; - Triangle[2].X = i * (int)_size_x + 8; Triangle[2].Y = j * (int)_size_y + 5; - g.FillPolygon(barrierColor, Triangle); - } - protected override void DrawRoadPart(Graphics g, int i, int j) - { - g.FillRectangle(roadColor, i * _size_x, j * _size_y, i * (_size_x + 1), j * (_size_y + 1)); - - } - protected override void GenerateMap() - { - _map = new int[100, 100]; - _size_x = (float)_width / _map.GetLength(0); - _size_y = (float)_height / _map.GetLength(1); - int counter = 0; - for (int i = 0; i < _map.GetLength(0); ++i) - { - for (int j = 0; j < _map.GetLength(1); ++j) - { - _map[i, j] = _freeRoad; - } - } - - while (counter < 30) - { - int x = _random.Next(0, 100); - int y = _random.Next(0, 100); - if (_map[x, y] == _freeRoad) - { - _map[x, y] = _barrier; - counter++; - } - } - } - } -} diff --git a/ProjectPlane/ProjectPlane/FormMapWithSetPlanes.Designer.cs b/ProjectPlane/ProjectPlane/FormMapWithSetPlanes.Designer.cs index 527147e..a5413d9 100644 --- a/ProjectPlane/ProjectPlane/FormMapWithSetPlanes.Designer.cs +++ b/ProjectPlane/ProjectPlane/FormMapWithSetPlanes.Designer.cs @@ -160,8 +160,7 @@ this.comboBoxSelectorMap.FormattingEnabled = true; this.comboBoxSelectorMap.Items.AddRange(new object[] { "Simple map", - "Sky map", - "Airfield map"}); + "Sky map"}); this.comboBoxSelectorMap.Location = new System.Drawing.Point(17, 32); this.comboBoxSelectorMap.Name = "comboBoxSelectorMap"; this.comboBoxSelectorMap.Size = new System.Drawing.Size(175, 23); diff --git a/ProjectPlane/ProjectPlane/FormMapWithSetPlanes.cs b/ProjectPlane/ProjectPlane/FormMapWithSetPlanes.cs index 46feda5..5436a47 100644 --- a/ProjectPlane/ProjectPlane/FormMapWithSetPlanes.cs +++ b/ProjectPlane/ProjectPlane/FormMapWithSetPlanes.cs @@ -40,9 +40,6 @@ namespace ProjectPlane case "Sky map": map = new SkyMap(); break; - case "Airfield map": - map = new AirfieldMap(); - break; } if (map != null) diff --git a/ProjectPlane/ProjectPlane/SetPlanesGeneric.cs b/ProjectPlane/ProjectPlane/SetPlanesGeneric.cs index 288a49c..e84b88a 100644 --- a/ProjectPlane/ProjectPlane/SetPlanesGeneric.cs +++ b/ProjectPlane/ProjectPlane/SetPlanesGeneric.cs @@ -83,8 +83,9 @@ namespace ProjectPlane { return null; } + T temp = _places[position]; _places[position] = null; - return _places[position]; + return temp; } /// /// Получение объекта из набора по позиции