From 634434095086ca0e2556b6f7e91b4dead7395ad6 Mon Sep 17 00:00:00 2001
From: ksenianeva <95441235+ksenianeva@users.noreply.github.com>
Date: Tue, 1 Nov 2022 12:19:04 +0400
Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B3=D1=80=D1=83?=
=?UTF-8?q?=D0=B7=D0=BA=D0=B0=20=D0=BE=D0=BF=D0=B5=D1=80=D0=B0=D1=82=D0=BE?=
=?UTF-8?q?=D1=80=D0=BE=D0=B2.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../FormMapWithSetShips.Designer.cs | 9 ++
.../ContainerShip/FormMapWithSetShips.cs | 22 ++--
.../ContainerShip/FormShip.Designer.cs | 116 +++++++++---------
ContainerShip/ContainerShip/FormShip.cs | 57 +++++++--
.../ContainerShip/MapWithSetShipsGeneric.cs | 44 +++----
.../ContainerShip/SetShipsGeneric.cs | 17 +--
6 files changed, 155 insertions(+), 110 deletions(-)
diff --git a/ContainerShip/ContainerShip/FormMapWithSetShips.Designer.cs b/ContainerShip/ContainerShip/FormMapWithSetShips.Designer.cs
index 7143ba1..4e94da7 100644
--- a/ContainerShip/ContainerShip/FormMapWithSetShips.Designer.cs
+++ b/ContainerShip/ContainerShip/FormMapWithSetShips.Designer.cs
@@ -72,6 +72,7 @@
this.ButtonAddShip.TabIndex = 11;
this.ButtonAddShip.Text = "Добавить корабль";
this.ButtonAddShip.UseVisualStyleBackColor = true;
+ this.ButtonAddShip.Click += new System.EventHandler(this.ButtonAddShip_Click);
//
// ComboBoxSelectorMap
//
@@ -83,6 +84,7 @@
this.ComboBoxSelectorMap.Name = "ComboBoxSelectorMap";
this.ComboBoxSelectorMap.Size = new System.Drawing.Size(288, 33);
this.ComboBoxSelectorMap.TabIndex = 10;
+ this.ComboBoxSelectorMap.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSelectorMap_SelectedIndexChanged);
//
// buttonUp
//
@@ -94,6 +96,7 @@
this.buttonUp.Size = new System.Drawing.Size(50, 50);
this.buttonUp.TabIndex = 9;
this.buttonUp.UseVisualStyleBackColor = true;
+ this.buttonUp.Click += new System.EventHandler(this.ButtonMove_Click);
//
// buttonRight
//
@@ -105,6 +108,7 @@
this.buttonRight.Size = new System.Drawing.Size(50, 50);
this.buttonRight.TabIndex = 8;
this.buttonRight.UseVisualStyleBackColor = true;
+ this.buttonRight.Click += new System.EventHandler(this.ButtonMove_Click);
//
// buttonDown
//
@@ -116,6 +120,7 @@
this.buttonDown.Size = new System.Drawing.Size(50, 50);
this.buttonDown.TabIndex = 7;
this.buttonDown.UseVisualStyleBackColor = true;
+ this.buttonDown.Click += new System.EventHandler(this.ButtonMove_Click);
//
// buttonLeft
//
@@ -127,6 +132,7 @@
this.buttonLeft.Size = new System.Drawing.Size(50, 50);
this.buttonLeft.TabIndex = 6;
this.buttonLeft.UseVisualStyleBackColor = true;
+ this.buttonLeft.Click += new System.EventHandler(this.ButtonMove_Click);
//
// button3
//
@@ -136,6 +142,7 @@
this.button3.TabIndex = 3;
this.button3.Text = "Посмотреть карту";
this.button3.UseVisualStyleBackColor = true;
+ this.button3.Click += new System.EventHandler(this.ButtonShowOnMap_Click);
//
// ButtonShowStorage
//
@@ -145,6 +152,7 @@
this.ButtonShowStorage.TabIndex = 2;
this.ButtonShowStorage.Text = "Просмотреть хранилище";
this.ButtonShowStorage.UseVisualStyleBackColor = true;
+ this.ButtonShowStorage.Click += new System.EventHandler(this.ButtonShowStorage_Click);
//
// ButtonRemoveShip
//
@@ -154,6 +162,7 @@
this.ButtonRemoveShip.TabIndex = 1;
this.ButtonRemoveShip.Text = "Удалить корабль";
this.ButtonRemoveShip.UseVisualStyleBackColor = true;
+ this.ButtonRemoveShip.Click += new System.EventHandler(this.ButtonRemoveShip_Click);
//
// maskedTextBoxPosition
//
diff --git a/ContainerShip/ContainerShip/FormMapWithSetShips.cs b/ContainerShip/ContainerShip/FormMapWithSetShips.cs
index a2841b2..faa900b 100644
--- a/ContainerShip/ContainerShip/FormMapWithSetShips.cs
+++ b/ContainerShip/ContainerShip/FormMapWithSetShips.cs
@@ -25,10 +25,8 @@ namespace ContainerShip
InitializeComponent();
}
///
- /// Выбор карты
+ /// Добавление объекта
///
- ///
- ///
private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e)
{
AbstractMap map = null;
@@ -43,17 +41,13 @@ namespace ContainerShip
}
if (map != null)
{
- _mapShipsCollectionGeneric = new MapWithSetShipsGeneric(
- pictureBox.Width, pictureBox.Height, map);
+ _mapShipsCollectionGeneric = new MapWithSetShipsGeneric(pictureBox.Width, pictureBox.Height, map);
}
else
- {
- _mapShipsCollectionGeneric = null;
- }
+{
+ _mapShipsCollectionGeneric = null;
+}
}
- ///
- /// Добавление объекта
- ///
///
///
private void ButtonAddShip_Click(object sender, EventArgs e)
@@ -65,8 +59,8 @@ namespace ContainerShip
FormShip form = new();
if (form.ShowDialog() == DialogResult.OK)
{
- DrawingObjectShip car = new(form.SelectedShip);
- if (_mapShipsCollectionGeneric + car)
+ DrawingObjectShip ship = new(form.SelectedShip);
+ if (_mapShipsCollectionGeneric + ship != -1)
{
MessageBox.Show("Объект добавлен");
pictureBox.Image = _mapShipsCollectionGeneric.ShowSet();
@@ -93,7 +87,7 @@ namespace ContainerShip
return;
}
int pos = Convert.ToInt32(maskedTextBoxPosition.Text);
- if (_mapShipsCollectionGeneric - pos)
+ if (_mapShipsCollectionGeneric - pos != null)
{
MessageBox.Show("Объект удален");
pictureBox.Image = _mapShipsCollectionGeneric.ShowSet();
diff --git a/ContainerShip/ContainerShip/FormShip.Designer.cs b/ContainerShip/ContainerShip/FormShip.Designer.cs
index d6f56ff..b786c0b 100644
--- a/ContainerShip/ContainerShip/FormShip.Designer.cs
+++ b/ContainerShip/ContainerShip/FormShip.Designer.cs
@@ -32,14 +32,14 @@
this.toolStripStatusLabelSpeed = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabelWeight = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabelBodyColor = new System.Windows.Forms.ToolStripStatusLabel();
- this.buttonRight = new System.Windows.Forms.Button();
- this.buttonUp = new System.Windows.Forms.Button();
- this.buttonDown = new System.Windows.Forms.Button();
- this.buttonLeft = new System.Windows.Forms.Button();
this.pictureBoxShip = new System.Windows.Forms.PictureBox();
this.ButtonCreate = new System.Windows.Forms.Button();
this.ButtonCreateModif = new System.Windows.Forms.Button();
this.ButtonSelectShip = new System.Windows.Forms.Button();
+ this.buttonRight = new System.Windows.Forms.Button();
+ this.buttonLeft = new System.Windows.Forms.Button();
+ this.buttonUp = new System.Windows.Forms.Button();
+ this.buttonDown = new System.Windows.Forms.Button();
this.statusStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxShip)).BeginInit();
this.SuspendLayout();
@@ -62,66 +62,21 @@
this.toolStripStatusLabelSpeed.Name = "toolStripStatusLabelSpeed";
this.toolStripStatusLabelSpeed.Size = new System.Drawing.Size(93, 25);
this.toolStripStatusLabelSpeed.Text = "Скорость:";
+ this.toolStripStatusLabelSpeed.Click += new System.EventHandler(this.toolStripStatusLabelSpeed_Click);
//
// toolStripStatusLabelWeight
//
this.toolStripStatusLabelWeight.Name = "toolStripStatusLabelWeight";
this.toolStripStatusLabelWeight.Size = new System.Drawing.Size(43, 25);
this.toolStripStatusLabelWeight.Text = "Вес:";
+ this.toolStripStatusLabelWeight.Click += new System.EventHandler(this.toolStripStatusLabelWeight_Click);
//
// toolStripStatusLabelBodyColor
//
this.toolStripStatusLabelBodyColor.Name = "toolStripStatusLabelBodyColor";
this.toolStripStatusLabelBodyColor.Size = new System.Drawing.Size(55, 25);
this.toolStripStatusLabelBodyColor.Text = "Цвет:";
- //
- // buttonRight
- //
- this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.buttonRight.BackgroundImage = global::ContainerShip.Properties.Resources.LeftArrow;
- this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
- this.buttonRight.Location = new System.Drawing.Point(738, 362);
- this.buttonRight.Name = "buttonRight";
- this.buttonRight.Size = new System.Drawing.Size(50, 50);
- this.buttonRight.TabIndex = 2;
- this.buttonRight.UseVisualStyleBackColor = true;
- this.buttonRight.Click += new System.EventHandler(this.ButtonMove_Click);
- //
- // buttonUp
- //
- this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.buttonUp.BackgroundImage = global::ContainerShip.Properties.Resources.upArrow;
- this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
- this.buttonUp.Location = new System.Drawing.Point(682, 306);
- this.buttonUp.Name = "buttonUp";
- this.buttonUp.Size = new System.Drawing.Size(50, 50);
- this.buttonUp.TabIndex = 3;
- this.buttonUp.UseVisualStyleBackColor = true;
- this.buttonUp.Click += new System.EventHandler(this.ButtonMove_Click);
- //
- // buttonDown
- //
- this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.buttonDown.BackgroundImage = global::ContainerShip.Properties.Resources.DownArrow;
- this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
- this.buttonDown.Location = new System.Drawing.Point(682, 362);
- this.buttonDown.Name = "buttonDown";
- this.buttonDown.Size = new System.Drawing.Size(50, 50);
- this.buttonDown.TabIndex = 4;
- this.buttonDown.UseVisualStyleBackColor = true;
- this.buttonDown.Click += new System.EventHandler(this.ButtonMove_Click);
- //
- // buttonLeft
- //
- this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.buttonLeft.BackgroundImage = global::ContainerShip.Properties.Resources.RightArrow;
- this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
- this.buttonLeft.Location = new System.Drawing.Point(626, 362);
- this.buttonLeft.Name = "buttonLeft";
- this.buttonLeft.Size = new System.Drawing.Size(50, 50);
- this.buttonLeft.TabIndex = 5;
- this.buttonLeft.UseVisualStyleBackColor = true;
- this.buttonLeft.Click += new System.EventHandler(this.ButtonMove_Click);
+ this.toolStripStatusLabelBodyColor.Click += new System.EventHandler(this.toolStripStatusLabelBodyColor_Click);
//
// pictureBoxShip
//
@@ -131,6 +86,7 @@
this.pictureBoxShip.Size = new System.Drawing.Size(800, 418);
this.pictureBoxShip.TabIndex = 7;
this.pictureBoxShip.TabStop = false;
+ this.pictureBoxShip.Click += new System.EventHandler(this.pictureBoxShip_Click);
//
// ButtonCreate
//
@@ -168,6 +124,54 @@
this.ButtonSelectShip.UseVisualStyleBackColor = false;
this.ButtonSelectShip.Click += new System.EventHandler(this.ButtonSelectShip_Click);
//
+ // buttonRight
+ //
+ this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonRight.BackgroundImage = global::ContainerShip.Properties.Resources.LeftArrow;
+ this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+ this.buttonRight.Location = new System.Drawing.Point(738, 362);
+ this.buttonRight.Name = "buttonRight";
+ this.buttonRight.Size = new System.Drawing.Size(50, 50);
+ this.buttonRight.TabIndex = 2;
+ this.buttonRight.UseVisualStyleBackColor = true;
+ this.buttonRight.Click += new System.EventHandler(this.ButtonMove_Click);
+ //
+ // buttonLeft
+ //
+ this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonLeft.BackgroundImage = global::ContainerShip.Properties.Resources.RightArrow;
+ this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+ this.buttonLeft.Location = new System.Drawing.Point(626, 362);
+ this.buttonLeft.Name = "buttonLeft";
+ this.buttonLeft.Size = new System.Drawing.Size(50, 50);
+ this.buttonLeft.TabIndex = 5;
+ this.buttonLeft.UseVisualStyleBackColor = true;
+ this.buttonLeft.Click += new System.EventHandler(this.ButtonMove_Click);
+ //
+ // buttonUp
+ //
+ this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonUp.BackgroundImage = global::ContainerShip.Properties.Resources.upArrow;
+ this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+ this.buttonUp.Location = new System.Drawing.Point(682, 306);
+ this.buttonUp.Name = "buttonUp";
+ this.buttonUp.Size = new System.Drawing.Size(50, 50);
+ this.buttonUp.TabIndex = 3;
+ this.buttonUp.UseVisualStyleBackColor = true;
+ this.buttonUp.Click += new System.EventHandler(this.ButtonMove_Click);
+ //
+ // buttonDown
+ //
+ this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonDown.BackgroundImage = global::ContainerShip.Properties.Resources.DownArrow;
+ this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
+ this.buttonDown.Location = new System.Drawing.Point(682, 362);
+ this.buttonDown.Name = "buttonDown";
+ this.buttonDown.Size = new System.Drawing.Size(50, 50);
+ this.buttonDown.TabIndex = 4;
+ this.buttonDown.UseVisualStyleBackColor = true;
+ this.buttonDown.Click += new System.EventHandler(this.ButtonMove_Click);
+ //
// FormShip
//
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 25F);
@@ -196,10 +200,6 @@
#endregion
private StatusStrip statusStrip1;
- private Button buttonRight;
- private Button buttonUp;
- private Button buttonDown;
- private Button buttonLeft;
private ToolStripStatusLabel toolStripStatusLabelSpeed;
private ToolStripStatusLabel toolStripStatusLabelWeight;
private ToolStripStatusLabel toolStripStatusLabelBodyColor;
@@ -207,5 +207,9 @@
private Button ButtonCreate;
private Button ButtonCreateModif;
private Button ButtonSelectShip;
+ private Button buttonRight;
+ private Button buttonLeft;
+ private Button buttonUp;
+ private Button buttonDown;
}
}
\ No newline at end of file
diff --git a/ContainerShip/ContainerShip/FormShip.cs b/ContainerShip/ContainerShip/FormShip.cs
index f9850da..58377a5 100644
--- a/ContainerShip/ContainerShip/FormShip.cs
+++ b/ContainerShip/ContainerShip/FormShip.cs
@@ -1,3 +1,5 @@
+using System.Drawing;
+
namespace ContainerShip
{
public partial class FormShip : Form
@@ -75,22 +77,35 @@ namespace ContainerShip
}
private void ButtonCreate_Click(object sender, EventArgs e)
{
- Random rnd = new();
- _ship = new DrawingShip(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));
- _ship.SetPosition(rnd.Next(10, 100), rnd.Next(10, 100), pictureBoxShip.Width, pictureBoxShip.Height);
- toolStripStatusLabelSpeed.Text = $": {_ship.Ship.Speed}";
- toolStripStatusLabelWeight.Text = $": {_ship.Ship.Weight}";
- toolStripStatusLabelBodyColor.Text = $": {_ship.Ship.BodyColor.Name}";
- Draw();
+ Random rnd = new();
+ 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;
+ }
+ _ship = new DrawingShip(rnd.Next(100, 300), rnd.Next(1000, 2000), color);
+ SetData();
+ Draw();
}
private void ButtonCreateModif_Click(object sender, EventArgs e)
{
Random rnd = new();
- _ship = new DrawingContainerShip(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;
+ }
+ _ship = new DrawingContainerShip(rnd.Next(100, 300), rnd.Next(1000, 2000), color, dopColor,
+ Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0, 2)));
SetData();
Draw();
}
@@ -100,5 +115,25 @@ namespace ContainerShip
SelectedShip = _ship;
DialogResult = DialogResult.OK;
}
+
+ private void pictureBoxShip_Click(object sender, EventArgs e)
+ {
+
+ }
+
+ private void toolStripStatusLabelBodyColor_Click(object sender, EventArgs e)
+ {
+
+ }
+
+ private void toolStripStatusLabelWeight_Click(object sender, EventArgs e)
+ {
+
+ }
+
+ private void toolStripStatusLabelSpeed_Click(object sender, EventArgs e)
+ {
+
+ }
}
}
\ No newline at end of file
diff --git a/ContainerShip/ContainerShip/MapWithSetShipsGeneric.cs b/ContainerShip/ContainerShip/MapWithSetShipsGeneric.cs
index c474137..dfda657 100644
--- a/ContainerShip/ContainerShip/MapWithSetShipsGeneric.cs
+++ b/ContainerShip/ContainerShip/MapWithSetShipsGeneric.cs
@@ -50,26 +50,6 @@ namespace ContainerShip
_map = map;
}
///
- /// Перегрузка оператора сложения
- ///
- ///
- ///
- ///
- public static bool operator +(MapWithSetShipsGeneric map, T ship)
- {
- return map._setShips.Insert(ship);
- }
- ///
- /// Перегрузка оператора вычитания
- ///
- ///
- ///
- ///
- public static bool operator -(MapWithSetShipsGeneric map, int position)
- {
- return map._setShips.Remove(position);
- }
- ///
/// Вывод всего набора объектов
///
///
@@ -163,9 +143,31 @@ namespace ContainerShip
{
for (int i = 0; i < _setShips.Count; i++)
{
- //TODO установка позиции
+ int countOfShipsInLine = _pictureWidth / _placeSizeWidth;
+ int countOfShipsInColumn = _pictureHeight / _placeSizeHeight;
+ _setShips.Get(i)?.SetObject((countOfShipsInLine - (i % countOfShipsInLine) - 1) * _placeSizeWidth, (countOfShipsInColumn - (i / countOfShipsInLine) - 1) * _placeSizeHeight, _pictureWidth, _pictureHeight);
_setShips.Get(i)?.DrawingObject(g);
}
}
+ ///
+ /// Перегрузка операторов
+ ///
+ ///
+ ///
+ ///
+ public static int operator +(MapWithSetShipsGeneric map, T ship)
+ {
+ return map._setShips.Insert(ship);
+ }
+ ///
+ /// Перегрузка оператора вычитания
+ ///
+ ///
+ ///
+ ///
+ public static T operator -(MapWithSetShipsGeneric map, int position)
+ {
+ return map._setShips.Remove(position);
+ }
}
}
diff --git a/ContainerShip/ContainerShip/SetShipsGeneric.cs b/ContainerShip/ContainerShip/SetShipsGeneric.cs
index c299746..883942d 100644
--- a/ContainerShip/ContainerShip/SetShipsGeneric.cs
+++ b/ContainerShip/ContainerShip/SetShipsGeneric.cs
@@ -30,7 +30,7 @@ namespace ContainerShip
///
/// Добавляемый автомобиль
///
- public bool Insert(T ship)
+ public int Insert(T ship)
{
return Insert(ship, 0);
}
@@ -40,11 +40,11 @@ namespace ContainerShip
/// Добавляемый корабль
/// Позиция
///
- public bool Insert(T ship, int position)
+ public int Insert(T ship, int position)
{
if (position < 0 || position >= _places.Length)
{
- return false;
+ return -1;
}
if (_places[position] == null)
{
@@ -63,7 +63,7 @@ namespace ContainerShip
}
if (freePlace == -1)
{
- return false;
+ return -1;
}
else
{
@@ -76,21 +76,22 @@ namespace ContainerShip
_places[position] = ship;
}
}
- return true;
+ return position;
}
///
/// Удаление объекта из набора с конкретной позиции
///
///
///
- public bool Remove(int position)
+ public T Remove(int position)
{
if (position < 0 || position >= _places.Length)
{
- return false;
+ return null;
}
+ T ship = _places[position];
_places[position] = null;
- return true;
+ return ship;
}
///
/// Получение объекта из набора по позиции