Ну все пора пулл реквест делать хихихи

This commit is contained in:
devil_1nc 2022-10-12 21:41:07 +04:00
parent 4114801ea9
commit 01370364b6
4 changed files with 3 additions and 66 deletions

View File

@ -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
{
/// <summary>
/// Цвет участка закрытого
/// </summary>
private readonly Brush barrierColor = new SolidBrush(Color.Black);
private readonly Brush lineColor = new SolidBrush(Color.Yellow);
/// <summary>
/// Цвет участка открытого
/// </summary>
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++;
}
}
}
}
}

View File

@ -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);

View File

@ -40,9 +40,6 @@ namespace ProjectPlane
case "Sky map":
map = new SkyMap();
break;
case "Airfield map":
map = new AirfieldMap();
break;
}
if (map != null)

View File

@ -83,8 +83,9 @@ namespace ProjectPlane
{
return null;
}
T temp = _places[position];
_places[position] = null;
return _places[position];
return temp;
}
/// <summary>
/// Получение объекта из набора по позиции