From 017b18a3db2276cb466429e7688928b7ef47650f Mon Sep 17 00:00:00 2001 From: Anastasia Date: Sun, 13 Nov 2022 09:50:31 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20=D0=B8?= =?UTF-8?q?=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AirplaneWithRadar/AbstractMap.cs | 2 - .../AirplaneWithRadar/BlockMap.cs | 3 - .../AirplaneWithRadar/DrawingAirplane.cs | 32 ++++------- .../DrawingAirplaneWithRadar.cs | 11 +--- .../DrawingObjectAirplane.cs | 1 - .../AirplaneWithRadar/EntityAirplane.cs | 7 +-- .../EntityAirplaneWithRadar.cs | 12 ++-- .../FormAirplaneWithRadar.Designer.cs | 1 - .../FormAirplaneWithRadar.cs | 49 +++++++--------- .../FormMapWithSetAirplanes.cs | 14 +---- .../AirplaneWithRadar/IDrawingObject.cs | 8 +-- .../AirplaneWithRadar/LineMap.cs | 7 +-- .../MapWithSetAirplanesGeneric.cs | 11 +--- .../AirplaneWithRadar/Program.cs | 2 - .../AirplaneWithRadar/SetAirplanesGeneric.cs | 57 ++++++++----------- 15 files changed, 70 insertions(+), 147 deletions(-) diff --git a/AirplaneWithRadar/AirplaneWithRadar/AbstractMap.cs b/AirplaneWithRadar/AirplaneWithRadar/AbstractMap.cs index ea02d63..8c78481 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/AbstractMap.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/AbstractMap.cs @@ -96,13 +96,11 @@ namespace AirplaneWithRadar int x = _random.Next(0, 10); int y = _random.Next(0, 10); _drawingObject.SetObject(x, y, _width, _height); - // TODO проверка, что объект не "накладывается" на закрытые участки if (!CheckBarriers(0, 0, 0, 0)) { return false; } return true; - } private Bitmap DrawMapWithObject() { diff --git a/AirplaneWithRadar/AirplaneWithRadar/BlockMap.cs b/AirplaneWithRadar/AirplaneWithRadar/BlockMap.cs index 2c920c7..a845946 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/BlockMap.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/BlockMap.cs @@ -26,7 +26,6 @@ namespace AirplaneWithRadar protected override void DrawRoadPart(Graphics g, int i, int j) { g.FillRectangle(roadColor, i * _size_x, j * _size_y, (i + 1) * (_size_x + 1), (j + 1) * (_size_y + 1)); - } protected override void GenerateMap() @@ -49,7 +48,6 @@ namespace AirplaneWithRadar int y = _random.Next(0, 80); int blockWidth = _random.Next(0, 19); int blockHeight = _random.Next(0, 19); - bool isFree = true; for (int i = x; i < x + blockWidth; i++) { @@ -60,7 +58,6 @@ namespace AirplaneWithRadar isFree = false; break; } - } } if (isFree) diff --git a/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplane.cs b/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplane.cs index efeeeb9..c82432b 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplane.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplane.cs @@ -16,11 +16,11 @@ namespace AirplaneWithRadar /// public EntityAirplane Airplane { get; protected set; } /// - /// Левая координата отрисовки автомобиля + /// Левая координата отрисовки самолета /// protected float _startPosX; /// - /// Верхняя кооридната отрисовки автомобиля + /// Верхняя кооридната отрисовки самолета /// protected float _startPosY; /// @@ -32,18 +32,18 @@ namespace AirplaneWithRadar /// private int? _pictureHeight = null; /// - /// Ширина отрисовки автомобиля + /// Ширина отрисовки самолета /// private readonly int _airplaneWidth = 303; /// - /// Высота отрисовки автомобиля + /// Высота отрисовки самолета /// private readonly int _airplaneHeight = 107; /// /// Инициализация свойств /// /// Скорость - /// Вес автомобиля + /// Вес самолета /// Цвет кузова public DrawingAirplane(int speed, float weight, Color bodyColor) { @@ -53,10 +53,10 @@ namespace AirplaneWithRadar /// Инициализация свойств /// /// Скорость - /// Вес автомобиля + /// Вес самолета /// Цвет кузова - /// Ширина отрисовки автомобиля - /// Высота отрисовки автомобиля + /// Ширина отрисовки самолета + /// Высота отрисовки самолета protected DrawingAirplane(int speed, float weight, Color bodyColor, int airplaneWidth, int airplaneHeight) : this(speed, weight, bodyColor) { @@ -64,7 +64,7 @@ namespace AirplaneWithRadar _airplaneHeight = airplaneHeight; } /// - /// Установка позиции автомобиля + /// Установка позиции самолета /// /// Координата X /// Координата Y @@ -72,7 +72,6 @@ namespace AirplaneWithRadar /// Высота картинки public void SetPosition(int x, int y, int width, int height) { - // TODO checks if (x > 0 && x < width) { _startPosX = x; @@ -89,12 +88,6 @@ namespace AirplaneWithRadar { _pictureHeight = height; } - - - //_startPosX = x; - //_startPosY = y; - //_pictureWidth = width; - //_pictureHeight = height; } /// /// Изменение направления пермещения @@ -108,28 +101,24 @@ namespace AirplaneWithRadar } switch (direction) { - // вправо case Direction.Right: if (_startPosX + _airplaneWidth + Airplane.Step < _pictureWidth) { _startPosX += Airplane.Step; } break; - //влево case Direction.Left: if (_startPosX - Airplane.Step > 0) { _startPosX -= Airplane.Step; } break; - //вверх case Direction.Up: if (_startPosY - Airplane.Step > 0) { _startPosY -= Airplane.Step; } break; - //вниз case Direction.Down: if (_startPosY + _airplaneHeight + Airplane.Step < _pictureHeight) { @@ -139,7 +128,7 @@ namespace AirplaneWithRadar } } /// - /// Отрисовка автомобиля + /// Отрисовка самолета /// /// public virtual void DrawTransport(Graphics g) @@ -218,6 +207,5 @@ namespace AirplaneWithRadar { return (_startPosX, _startPosX + _airplaneWidth, _startPosY, _startPosY + _airplaneHeight); } - } } diff --git a/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplaneWithRadar.cs b/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplaneWithRadar.cs index ea5724a..e0b4f4e 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplaneWithRadar.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/DrawingAirplaneWithRadar.cs @@ -12,16 +12,15 @@ namespace AirplaneWithRadar /// Инициализация свойств /// /// Скорость - /// Вес автомобиля + /// Вес самолета /// Цвет кузова /// Дополнительный цвет - /// Признак наличия обвеса - /// Признак наличия антикрыла + /// Признак наличия радара + /// Признак наличия дополнительных топливных баков public DrawingAirplaneWithRadar(int speed, float weight, Color bodyColor, Color dopColor, bool radar, bool extraFuelTank) : base(speed, weight, bodyColor, 303, 102) { Airplane = new EntityAirplaneWithRadar(speed, weight, bodyColor, dopColor, radar, extraFuelTank); } - public override void DrawTransport(Graphics g) { if (Airplane is not EntityAirplaneWithRadar airplaneWithRadar) @@ -30,7 +29,6 @@ namespace AirplaneWithRadar } Pen pen = new(Color.Black, 5); Brush dopBrush = new SolidBrush(airplaneWithRadar.DopColor); - if (airplaneWithRadar.Radar) { g.DrawLine(pen, _startPosX + 120, _startPosY + 30, _startPosX + 110, _startPosY + 60); @@ -43,15 +41,12 @@ namespace AirplaneWithRadar g.FillPolygon(dopBrush, radarPoints); g.DrawEllipse(pen, _startPosX + 85, _startPosY + 15, 90, 20); g.FillEllipse(dopBrush, _startPosX + 85, _startPosY + 15, 90, 20); - } - _startPosX += 10; _startPosY += 5; base.DrawTransport(g); _startPosX -= 10; _startPosY -= 5; - if (airplaneWithRadar.ExtraFuelTank) { g.DrawLine(pen, _startPosX + 145, _startPosY + 98, _startPosX + 145, _startPosY + 108); diff --git a/AirplaneWithRadar/AirplaneWithRadar/DrawingObjectAirplane.cs b/AirplaneWithRadar/AirplaneWithRadar/DrawingObjectAirplane.cs index 08ac4fd..fcd2c62 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/DrawingObjectAirplane.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/DrawingObjectAirplane.cs @@ -30,6 +30,5 @@ namespace AirplaneWithRadar { _airplane.DrawTransport(g); } - } } diff --git a/AirplaneWithRadar/AirplaneWithRadar/EntityAirplane.cs b/AirplaneWithRadar/AirplaneWithRadar/EntityAirplane.cs index bddb2ba..6502d80 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/EntityAirplane.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/EntityAirplane.cs @@ -25,11 +25,11 @@ namespace AirplaneWithRadar /// public Color BodyColor { get; private set; } /// - /// Шаг перемещения автомобиля + /// Шаг перемещения самолета /// public float Step => Speed * 100 / Weight; /// - /// Инициализация полей объекта-класса автомобиля + /// Инициализация полей объекта-класса самолета /// /// /// @@ -42,8 +42,5 @@ namespace AirplaneWithRadar Weight = weight <= 0 ? rnd.Next(40, 70) : weight; BodyColor = bodyColor; } - - - } } diff --git a/AirplaneWithRadar/AirplaneWithRadar/EntityAirplaneWithRadar.cs b/AirplaneWithRadar/AirplaneWithRadar/EntityAirplaneWithRadar.cs index 9026595..5c71fbd 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/EntityAirplaneWithRadar.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/EntityAirplaneWithRadar.cs @@ -13,29 +13,27 @@ namespace AirplaneWithRadar /// public Color DopColor { get; private set; } /// - /// Признак наличия обвеса + /// Признак наличия радара /// public bool Radar { get; private set; } /// - /// Признак наличия антикрыла + /// Признак наличия дополнительных топливных баков /// public bool ExtraFuelTank { get; private set; } /// /// Инициализация свойств /// /// Скорость - /// Вес автомобиля + /// Вес самолета /// Цвет кузова /// Дополнительный цвет - /// Признак наличия обвеса - /// Признак наличия антикрыла + /// Признак наличия радара + /// Признак наличия дополнительных топливных баков public EntityAirplaneWithRadar(int speed, float weight, Color bodyColor, Color dopColor, bool radar, bool extraFuelTank) : base(speed, weight, bodyColor) { DopColor = dopColor; Radar = radar; ExtraFuelTank = extraFuelTank; } - - } } diff --git a/AirplaneWithRadar/AirplaneWithRadar/FormAirplaneWithRadar.Designer.cs b/AirplaneWithRadar/AirplaneWithRadar/FormAirplaneWithRadar.Designer.cs index c21cf85..d0040e3 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/FormAirplaneWithRadar.Designer.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/FormAirplaneWithRadar.Designer.cs @@ -83,7 +83,6 @@ this.pictureBoxAirplane.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBoxAirplane.TabIndex = 1; this.pictureBoxAirplane.TabStop = false; - this.pictureBoxAirplane.Click += new System.EventHandler(this.pictureBoxAirplane_Click); // // buttonCreate // diff --git a/AirplaneWithRadar/AirplaneWithRadar/FormAirplaneWithRadar.cs b/AirplaneWithRadar/AirplaneWithRadar/FormAirplaneWithRadar.cs index d98ab40..21d57ce 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/FormAirplaneWithRadar.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/FormAirplaneWithRadar.cs @@ -3,16 +3,14 @@ namespace AirplaneWithRadar public partial class FormAirplaneWithRadar : Form { private DrawingAirplane _airplane; - public DrawingAirplane SelectedAirplane { get; private set; } public FormAirplaneWithRadar() { InitializeComponent(); } - /// - /// + /// /// private void Draw() { @@ -27,7 +25,6 @@ namespace AirplaneWithRadar private void SetData() { Random rnd = new(); - _airplane.SetPosition(rnd.Next(10, 100), rnd.Next(10, 100), pictureBoxAirplane.Width, pictureBoxAirplane.Height); toolStripStatusLabelSpeed.Text = $": {_airplane.Airplane.Speed}"; toolStripStatusLabelWeight.Text = $": {_airplane.Airplane.Weight}"; @@ -40,16 +37,20 @@ namespace AirplaneWithRadar /// private void ButtonCreate_Click(object sender, EventArgs e) { - Random rnd = new(); - _airplane = new DrawingAirplane(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256))); + Color color = Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)); + ColorDialog dialog = new(); + if (dialog.ShowDialog() == DialogResult.OK) + { + color = dialog.Color; + } + _airplane = new DrawingAirplane(rnd.Next(100, 300), rnd.Next(1000, 2000), color); SetData(); Draw(); } private void ButtonMove_Click(object sender, EventArgs e) { - // string name = ((Button)sender)?.Name ?? string.Empty; switch (name) { @@ -67,18 +68,6 @@ namespace AirplaneWithRadar break; } Draw(); - - } - - - private void FormAirplaneWithRadar_Load(object sender, EventArgs e) - { - - } - - private void pictureBoxAirplane_Click(object sender, EventArgs e) - { - } /// /// "" @@ -88,22 +77,26 @@ namespace AirplaneWithRadar private void ButtonCreateModif_Click(object sender, EventArgs e) { Random rnd = new(); - _airplane = new DrawingAirplaneWithRadar(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)), - Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)), Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0,2))); + Color color = Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)); + ColorDialog dialog = new(); + if (dialog.ShowDialog() == DialogResult.OK) + { + color = dialog.Color; + } + Color dopColor = Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)); + ColorDialog dialogDop = new(); + if (dialogDop.ShowDialog() == DialogResult.OK) + { + dopColor = dialogDop.Color; + } + _airplane = new DrawingAirplaneWithRadar(rnd.Next(100, 300), rnd.Next(1000, 2000), color, dopColor, Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0,2))); SetData(); Draw(); } - private void ButtonSelectAirplane_Click(object sender, EventArgs e) { SelectedAirplane = _airplane; DialogResult = DialogResult.OK; - - } - - private void FormAirplaneWithRadar_Load_1(object sender, EventArgs e) - { - } } } \ No newline at end of file diff --git a/AirplaneWithRadar/AirplaneWithRadar/FormMapWithSetAirplanes.cs b/AirplaneWithRadar/AirplaneWithRadar/FormMapWithSetAirplanes.cs index a55908f..5c2c226 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/FormMapWithSetAirplanes.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/FormMapWithSetAirplanes.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using static System.Windows.Forms.DataFormats; - -namespace AirplaneWithRadar +namespace AirplaneWithRadar { public partial class FormMapWithSetAirplanes : Form { @@ -142,7 +131,6 @@ namespace AirplaneWithRadar { return; } - //получаем имя кнопки string name = ((Button)sender)?.Name ?? string.Empty; Direction dir = Direction.None; switch (name) diff --git a/AirplaneWithRadar/AirplaneWithRadar/IDrawingObject.cs b/AirplaneWithRadar/AirplaneWithRadar/IDrawingObject.cs index 3e8a16c..0dcd348 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/IDrawingObject.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/IDrawingObject.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AirplaneWithRadar +namespace AirplaneWithRadar { /// /// Интерфейс для работы с объектом, прорисовываемым на форме diff --git a/AirplaneWithRadar/AirplaneWithRadar/LineMap.cs b/AirplaneWithRadar/AirplaneWithRadar/LineMap.cs index 2982b2d..28fc0d0 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/LineMap.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/LineMap.cs @@ -32,7 +32,6 @@ namespace AirplaneWithRadar _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) @@ -40,10 +39,7 @@ namespace AirplaneWithRadar _map[i, j] = _freeRoad; } } - - - int counter = 0; - + int counter; for (int j = 0; j < _map.GetLength(1); j++) { int startX = _random.Next(0, 80); @@ -59,7 +55,6 @@ namespace AirplaneWithRadar } j += 3; } - } } } diff --git a/AirplaneWithRadar/AirplaneWithRadar/MapWithSetAirplanesGeneric.cs b/AirplaneWithRadar/AirplaneWithRadar/MapWithSetAirplanesGeneric.cs index 8194b35..31b77aa 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/MapWithSetAirplanesGeneric.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/MapWithSetAirplanesGeneric.cs @@ -161,27 +161,23 @@ namespace AirplaneWithRadar /// private void DrawBackground(Graphics g) { - Pen pen = new(Color.White, 3); - g.FillRectangle(Brushes.Gray, 0, 0, _pictureWidth, _pictureHeight); - + Pen pen = new(Color.White, 5); + g.FillRectangle(Brushes.DimGray, 0, 0, _pictureWidth, _pictureHeight); for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++) { for (int j = 0; j < _pictureHeight / _placeSizeHeight; j++) { - g.DrawLine(pen, i * _placeSizeWidth, j * _placeSizeHeight, i * _placeSizeWidth + _placeSizeWidth * 3/4, j * _placeSizeHeight); + g.DrawLine(pen, i * _placeSizeWidth, j * _placeSizeHeight, i * _placeSizeWidth + _placeSizeWidth * 4/5, j * _placeSizeHeight); } g.DrawLine(pen, i * _placeSizeWidth, 0, i * _placeSizeWidth, (_pictureHeight / _placeSizeHeight) * _placeSizeHeight); - } } - /// /// Метод прорисовки объектов /// /// private void DrawAirplanes(Graphics g) { - int numInRow = _pictureWidth / _placeSizeWidth; int maxLeft = (numInRow - 1) * _placeSizeWidth; for (int i = 0; i < _setAirplanes.Count; i++) @@ -191,6 +187,5 @@ namespace AirplaneWithRadar airplane?.DrawingObject(g); } } - } } diff --git a/AirplaneWithRadar/AirplaneWithRadar/Program.cs b/AirplaneWithRadar/AirplaneWithRadar/Program.cs index f9ad494..64c7b13 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/Program.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/Program.cs @@ -8,8 +8,6 @@ namespace AirplaneWithRadar [STAThread] static void Main() { - // To customize application configuration such as set high DPI settings or default font, - // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); Application.Run(new FormMapWithSetAirplanes()); } diff --git a/AirplaneWithRadar/AirplaneWithRadar/SetAirplanesGeneric.cs b/AirplaneWithRadar/AirplaneWithRadar/SetAirplanesGeneric.cs index 8f2ce63..2a28e06 100644 --- a/AirplaneWithRadar/AirplaneWithRadar/SetAirplanesGeneric.cs +++ b/AirplaneWithRadar/AirplaneWithRadar/SetAirplanesGeneric.cs @@ -32,47 +32,33 @@ namespace AirplaneWithRadar /// /// Добавление объекта в набор /// - /// Добавляемый автомобиль + /// Добавляемый самолет /// public int Insert(T airplane) { - // TODO вставка в начало набора return Insert(airplane, 0); } /// /// Добавление объекта в набор на конкретную позицию /// - /// Добавляемый автомобиль + /// Добавляемый самолет /// Позиция /// public int Insert(T airplane, int position) { - // TODO проверка позиции - // TODO проверка, что элемент массива по этой позиции пустой, если нет, то проверка, что после вставляемого элемента в массиве есть пустой элемент - // сдвиг всех объектов, находящихся справа от позиции до первого пустого элемента - // TODO вставка по позиции - if (position >= _places.Length) + int positionNullElement = position; + while (Get(positionNullElement) != null) + { + positionNullElement++; + } + if (positionNullElement > Count || positionNullElement < 0) { return -1; } - if (_places[position] != null) + while (positionNullElement != position) { - int indexNull = -1; - for (int i = position; i < _places.Length; i++) - { - if (_places[i] == null) - { - indexNull = i; - break; - } - } - if (indexNull == -1) return -1; - for (int i = indexNull; i > position; i--) - { - T tmp = _places[i]; - _places[i] = _places[i - 1]; - _places[i - 1] = tmp; - } + _places[positionNullElement] = _places[positionNullElement - 1]; + positionNullElement--; } _places[position] = airplane; return position; @@ -84,15 +70,16 @@ namespace AirplaneWithRadar /// public T Remove(int position) { - // TODO проверка позиции - // TODO удаление объекта из массива, присовив элементу массива значение null - if (position >= _places.Length) + if (position > Count || position < 0) { return null; } - T removedObject = _places[position]; - _places[position] = null; - return removedObject; + else + { + var removedObject = _places[position]; + _places[position] = null; + return removedObject; + } } /// /// Получение объекта из набора по позиции @@ -101,12 +88,14 @@ namespace AirplaneWithRadar /// public T Get(int position) { - // TODO проверка позиции - if (position >= _places.Length) + if (position > Count || position < 0) { return null; } - return _places[position]; + else + { + return _places[position]; + } } } }