Compare commits
No commits in common. "68db88d4c401bdf00129780f6e16a8c7bac55eb9" and "8545247498a2299985533cbdab8377bf2ea4ebea" have entirely different histories.
68db88d4c4
...
8545247498
@ -29,136 +29,56 @@
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
this.groupBoxMaps = new System.Windows.Forms.GroupBox();
|
|
||||||
this.listBoxMaps = new System.Windows.Forms.ListBox();
|
|
||||||
this.buttonDeleteMap = new System.Windows.Forms.Button();
|
|
||||||
this.buttonAddMap = new System.Windows.Forms.Button();
|
|
||||||
this.textBoxNewMapName = new System.Windows.Forms.TextBox();
|
|
||||||
this.comboBoxSelectorMap = new System.Windows.Forms.ComboBox();
|
|
||||||
this.buttonDown = new System.Windows.Forms.Button();
|
this.buttonDown = new System.Windows.Forms.Button();
|
||||||
this.ButtonAddShip = new System.Windows.Forms.Button();
|
|
||||||
this.buttonUp = new System.Windows.Forms.Button();
|
this.buttonUp = new System.Windows.Forms.Button();
|
||||||
this.buttonRight = new System.Windows.Forms.Button();
|
this.buttonRight = new System.Windows.Forms.Button();
|
||||||
this.buttonLeft = new System.Windows.Forms.Button();
|
this.buttonLeft = new System.Windows.Forms.Button();
|
||||||
this.ButtonShowStorage = new System.Windows.Forms.Button();
|
this.ButtonShowStorage = new System.Windows.Forms.Button();
|
||||||
this.ButtonShowOnMap = new System.Windows.Forms.Button();
|
this.ButtonShowOnMap = new System.Windows.Forms.Button();
|
||||||
this.maskedTextBoxPosition = new System.Windows.Forms.MaskedTextBox();
|
this.maskedTextBoxPosition = new System.Windows.Forms.MaskedTextBox();
|
||||||
|
this.comboBoxSelectorMap = new System.Windows.Forms.ComboBox();
|
||||||
this.ButtonRemoveShip = new System.Windows.Forms.Button();
|
this.ButtonRemoveShip = new System.Windows.Forms.Button();
|
||||||
|
this.ButtonAddShip = new System.Windows.Forms.Button();
|
||||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||||
this.groupBox1.SuspendLayout();
|
this.groupBox1.SuspendLayout();
|
||||||
this.groupBoxMaps.SuspendLayout();
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// groupBox1
|
// groupBox1
|
||||||
//
|
//
|
||||||
this.groupBox1.Controls.Add(this.groupBoxMaps);
|
|
||||||
this.groupBox1.Controls.Add(this.buttonDown);
|
this.groupBox1.Controls.Add(this.buttonDown);
|
||||||
this.groupBox1.Controls.Add(this.ButtonAddShip);
|
|
||||||
this.groupBox1.Controls.Add(this.buttonUp);
|
this.groupBox1.Controls.Add(this.buttonUp);
|
||||||
this.groupBox1.Controls.Add(this.buttonRight);
|
this.groupBox1.Controls.Add(this.buttonRight);
|
||||||
this.groupBox1.Controls.Add(this.buttonLeft);
|
this.groupBox1.Controls.Add(this.buttonLeft);
|
||||||
this.groupBox1.Controls.Add(this.ButtonShowStorage);
|
this.groupBox1.Controls.Add(this.ButtonShowStorage);
|
||||||
this.groupBox1.Controls.Add(this.ButtonShowOnMap);
|
this.groupBox1.Controls.Add(this.ButtonShowOnMap);
|
||||||
this.groupBox1.Controls.Add(this.maskedTextBoxPosition);
|
this.groupBox1.Controls.Add(this.maskedTextBoxPosition);
|
||||||
|
this.groupBox1.Controls.Add(this.comboBoxSelectorMap);
|
||||||
this.groupBox1.Controls.Add(this.ButtonRemoveShip);
|
this.groupBox1.Controls.Add(this.ButtonRemoveShip);
|
||||||
|
this.groupBox1.Controls.Add(this.ButtonAddShip);
|
||||||
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Right;
|
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Right;
|
||||||
this.groupBox1.Location = new System.Drawing.Point(593, 0);
|
this.groupBox1.Location = new System.Drawing.Point(600, 0);
|
||||||
this.groupBox1.Name = "groupBox1";
|
this.groupBox1.Name = "groupBox1";
|
||||||
this.groupBox1.Size = new System.Drawing.Size(200, 582);
|
this.groupBox1.Size = new System.Drawing.Size(200, 450);
|
||||||
this.groupBox1.TabIndex = 1;
|
this.groupBox1.TabIndex = 1;
|
||||||
this.groupBox1.TabStop = false;
|
this.groupBox1.TabStop = false;
|
||||||
this.groupBox1.Text = "Инструменты";
|
|
||||||
//
|
|
||||||
// groupBoxMaps
|
|
||||||
//
|
|
||||||
this.groupBoxMaps.Controls.Add(this.listBoxMaps);
|
|
||||||
this.groupBoxMaps.Controls.Add(this.buttonDeleteMap);
|
|
||||||
this.groupBoxMaps.Controls.Add(this.buttonAddMap);
|
|
||||||
this.groupBoxMaps.Controls.Add(this.textBoxNewMapName);
|
|
||||||
this.groupBoxMaps.Controls.Add(this.comboBoxSelectorMap);
|
|
||||||
this.groupBoxMaps.Location = new System.Drawing.Point(6, 22);
|
|
||||||
this.groupBoxMaps.Name = "groupBoxMaps";
|
|
||||||
this.groupBoxMaps.Size = new System.Drawing.Size(188, 209);
|
|
||||||
this.groupBoxMaps.TabIndex = 12;
|
|
||||||
this.groupBoxMaps.TabStop = false;
|
|
||||||
this.groupBoxMaps.Text = "Карты";
|
|
||||||
//
|
|
||||||
// listBoxMaps
|
|
||||||
//
|
|
||||||
this.listBoxMaps.FormattingEnabled = true;
|
|
||||||
this.listBoxMaps.ItemHeight = 15;
|
|
||||||
this.listBoxMaps.Location = new System.Drawing.Point(6, 109);
|
|
||||||
this.listBoxMaps.Name = "listBoxMaps";
|
|
||||||
this.listBoxMaps.Size = new System.Drawing.Size(176, 64);
|
|
||||||
this.listBoxMaps.TabIndex = 7;
|
|
||||||
//
|
|
||||||
// buttonDeleteMap
|
|
||||||
//
|
|
||||||
this.buttonDeleteMap.Location = new System.Drawing.Point(6, 180);
|
|
||||||
this.buttonDeleteMap.Name = "buttonDeleteMap";
|
|
||||||
this.buttonDeleteMap.Size = new System.Drawing.Size(176, 23);
|
|
||||||
this.buttonDeleteMap.TabIndex = 6;
|
|
||||||
this.buttonDeleteMap.Text = "Удалить карту";
|
|
||||||
this.buttonDeleteMap.UseVisualStyleBackColor = true;
|
|
||||||
this.buttonDeleteMap.Click += new System.EventHandler(this.ButtonDeleteMap_Click);
|
|
||||||
//
|
|
||||||
// buttonAddMap
|
|
||||||
//
|
|
||||||
this.buttonAddMap.Location = new System.Drawing.Point(6, 80);
|
|
||||||
this.buttonAddMap.Name = "buttonAddMap";
|
|
||||||
this.buttonAddMap.Size = new System.Drawing.Size(176, 23);
|
|
||||||
this.buttonAddMap.TabIndex = 5;
|
|
||||||
this.buttonAddMap.Text = "Добавить карту";
|
|
||||||
this.buttonAddMap.UseVisualStyleBackColor = true;
|
|
||||||
this.buttonAddMap.Click += new System.EventHandler(this.ButtonAddMap_Click);
|
|
||||||
//
|
|
||||||
// textBoxNewMapName
|
|
||||||
//
|
|
||||||
this.textBoxNewMapName.Location = new System.Drawing.Point(6, 22);
|
|
||||||
this.textBoxNewMapName.Name = "textBoxNewMapName";
|
|
||||||
this.textBoxNewMapName.Size = new System.Drawing.Size(176, 23);
|
|
||||||
this.textBoxNewMapName.TabIndex = 0;
|
|
||||||
//
|
|
||||||
// comboBoxSelectorMap
|
|
||||||
//
|
|
||||||
this.comboBoxSelectorMap.FormattingEnabled = true;
|
|
||||||
this.comboBoxSelectorMap.Items.AddRange(new object[] {
|
|
||||||
"Простая карта",
|
|
||||||
"Море"});
|
|
||||||
this.comboBoxSelectorMap.Location = new System.Drawing.Point(6, 51);
|
|
||||||
this.comboBoxSelectorMap.Name = "comboBoxSelectorMap";
|
|
||||||
this.comboBoxSelectorMap.Size = new System.Drawing.Size(176, 23);
|
|
||||||
this.comboBoxSelectorMap.TabIndex = 4;
|
|
||||||
//
|
//
|
||||||
// buttonDown
|
// buttonDown
|
||||||
//
|
//
|
||||||
this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
|
||||||
this.buttonDown.BackgroundImage = global::WarmlyShip.Properties.Resources.Down;
|
this.buttonDown.BackgroundImage = global::WarmlyShip.Properties.Resources.Down;
|
||||||
this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
||||||
this.buttonDown.Location = new System.Drawing.Point(96, 536);
|
this.buttonDown.Location = new System.Drawing.Point(96, 388);
|
||||||
this.buttonDown.Name = "buttonDown";
|
this.buttonDown.Name = "buttonDown";
|
||||||
this.buttonDown.Size = new System.Drawing.Size(30, 30);
|
this.buttonDown.Size = new System.Drawing.Size(30, 30);
|
||||||
this.buttonDown.TabIndex = 11;
|
this.buttonDown.TabIndex = 11;
|
||||||
this.buttonDown.UseVisualStyleBackColor = true;
|
this.buttonDown.UseVisualStyleBackColor = true;
|
||||||
this.buttonDown.Click += new System.EventHandler(this.ButtonMove_Click);
|
this.buttonDown.Click += new System.EventHandler(this.ButtonMove_Click);
|
||||||
//
|
//
|
||||||
// ButtonAddShip
|
|
||||||
//
|
|
||||||
this.ButtonAddShip.Location = new System.Drawing.Point(12, 298);
|
|
||||||
this.ButtonAddShip.Name = "ButtonAddShip";
|
|
||||||
this.ButtonAddShip.Size = new System.Drawing.Size(176, 25);
|
|
||||||
this.ButtonAddShip.TabIndex = 2;
|
|
||||||
this.ButtonAddShip.Text = "Добавить корабль";
|
|
||||||
this.ButtonAddShip.UseVisualStyleBackColor = true;
|
|
||||||
this.ButtonAddShip.Click += new System.EventHandler(this.ButtonAddShip_Click);
|
|
||||||
//
|
|
||||||
// buttonUp
|
// buttonUp
|
||||||
//
|
//
|
||||||
this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
|
||||||
this.buttonUp.BackgroundImage = global::WarmlyShip.Properties.Resources.Up;
|
this.buttonUp.BackgroundImage = global::WarmlyShip.Properties.Resources.Up;
|
||||||
this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
||||||
this.buttonUp.Location = new System.Drawing.Point(96, 500);
|
this.buttonUp.Location = new System.Drawing.Point(96, 352);
|
||||||
this.buttonUp.Name = "buttonUp";
|
this.buttonUp.Name = "buttonUp";
|
||||||
this.buttonUp.Size = new System.Drawing.Size(30, 30);
|
this.buttonUp.Size = new System.Drawing.Size(30, 30);
|
||||||
this.buttonUp.TabIndex = 10;
|
this.buttonUp.TabIndex = 10;
|
||||||
@ -167,10 +87,9 @@
|
|||||||
//
|
//
|
||||||
// buttonRight
|
// buttonRight
|
||||||
//
|
//
|
||||||
this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
|
||||||
this.buttonRight.BackgroundImage = global::WarmlyShip.Properties.Resources.Right;
|
this.buttonRight.BackgroundImage = global::WarmlyShip.Properties.Resources.Right;
|
||||||
this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
||||||
this.buttonRight.Location = new System.Drawing.Point(132, 536);
|
this.buttonRight.Location = new System.Drawing.Point(132, 388);
|
||||||
this.buttonRight.Name = "buttonRight";
|
this.buttonRight.Name = "buttonRight";
|
||||||
this.buttonRight.Size = new System.Drawing.Size(30, 30);
|
this.buttonRight.Size = new System.Drawing.Size(30, 30);
|
||||||
this.buttonRight.TabIndex = 9;
|
this.buttonRight.TabIndex = 9;
|
||||||
@ -179,10 +98,9 @@
|
|||||||
//
|
//
|
||||||
// buttonLeft
|
// buttonLeft
|
||||||
//
|
//
|
||||||
this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
|
||||||
this.buttonLeft.BackgroundImage = global::WarmlyShip.Properties.Resources.Left;
|
this.buttonLeft.BackgroundImage = global::WarmlyShip.Properties.Resources.Left;
|
||||||
this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
||||||
this.buttonLeft.Location = new System.Drawing.Point(60, 536);
|
this.buttonLeft.Location = new System.Drawing.Point(60, 388);
|
||||||
this.buttonLeft.Name = "buttonLeft";
|
this.buttonLeft.Name = "buttonLeft";
|
||||||
this.buttonLeft.Size = new System.Drawing.Size(30, 30);
|
this.buttonLeft.Size = new System.Drawing.Size(30, 30);
|
||||||
this.buttonLeft.TabIndex = 8;
|
this.buttonLeft.TabIndex = 8;
|
||||||
@ -191,9 +109,9 @@
|
|||||||
//
|
//
|
||||||
// ButtonShowStorage
|
// ButtonShowStorage
|
||||||
//
|
//
|
||||||
this.ButtonShowStorage.Location = new System.Drawing.Point(12, 402);
|
this.ButtonShowStorage.Location = new System.Drawing.Point(6, 193);
|
||||||
this.ButtonShowStorage.Name = "ButtonShowStorage";
|
this.ButtonShowStorage.Name = "ButtonShowStorage";
|
||||||
this.ButtonShowStorage.Size = new System.Drawing.Size(176, 23);
|
this.ButtonShowStorage.Size = new System.Drawing.Size(182, 23);
|
||||||
this.ButtonShowStorage.TabIndex = 7;
|
this.ButtonShowStorage.TabIndex = 7;
|
||||||
this.ButtonShowStorage.Text = "Посмотреть хранилище";
|
this.ButtonShowStorage.Text = "Посмотреть хранилище";
|
||||||
this.ButtonShowStorage.UseVisualStyleBackColor = true;
|
this.ButtonShowStorage.UseVisualStyleBackColor = true;
|
||||||
@ -201,9 +119,9 @@
|
|||||||
//
|
//
|
||||||
// ButtonShowOnMap
|
// ButtonShowOnMap
|
||||||
//
|
//
|
||||||
this.ButtonShowOnMap.Location = new System.Drawing.Point(12, 431);
|
this.ButtonShowOnMap.Location = new System.Drawing.Point(6, 243);
|
||||||
this.ButtonShowOnMap.Name = "ButtonShowOnMap";
|
this.ButtonShowOnMap.Name = "ButtonShowOnMap";
|
||||||
this.ButtonShowOnMap.Size = new System.Drawing.Size(176, 23);
|
this.ButtonShowOnMap.Size = new System.Drawing.Size(188, 23);
|
||||||
this.ButtonShowOnMap.TabIndex = 6;
|
this.ButtonShowOnMap.TabIndex = 6;
|
||||||
this.ButtonShowOnMap.Text = "Посмотреть карту";
|
this.ButtonShowOnMap.Text = "Посмотреть карту";
|
||||||
this.ButtonShowOnMap.UseVisualStyleBackColor = true;
|
this.ButtonShowOnMap.UseVisualStyleBackColor = true;
|
||||||
@ -211,28 +129,50 @@
|
|||||||
//
|
//
|
||||||
// maskedTextBoxPosition
|
// maskedTextBoxPosition
|
||||||
//
|
//
|
||||||
this.maskedTextBoxPosition.Location = new System.Drawing.Point(12, 329);
|
this.maskedTextBoxPosition.Location = new System.Drawing.Point(6, 108);
|
||||||
this.maskedTextBoxPosition.Mask = "00";
|
this.maskedTextBoxPosition.Mask = "00";
|
||||||
this.maskedTextBoxPosition.Name = "maskedTextBoxPosition";
|
this.maskedTextBoxPosition.Name = "maskedTextBoxPosition";
|
||||||
this.maskedTextBoxPosition.Size = new System.Drawing.Size(176, 23);
|
this.maskedTextBoxPosition.Size = new System.Drawing.Size(188, 23);
|
||||||
this.maskedTextBoxPosition.TabIndex = 5;
|
this.maskedTextBoxPosition.TabIndex = 5;
|
||||||
//
|
//
|
||||||
|
// comboBoxSelectorMap
|
||||||
|
//
|
||||||
|
this.comboBoxSelectorMap.FormattingEnabled = true;
|
||||||
|
this.comboBoxSelectorMap.Items.AddRange(new object[] {
|
||||||
|
"Простая карта",
|
||||||
|
"Море"});
|
||||||
|
this.comboBoxSelectorMap.Location = new System.Drawing.Point(6, 32);
|
||||||
|
this.comboBoxSelectorMap.Name = "comboBoxSelectorMap";
|
||||||
|
this.comboBoxSelectorMap.Size = new System.Drawing.Size(188, 23);
|
||||||
|
this.comboBoxSelectorMap.TabIndex = 4;
|
||||||
|
this.comboBoxSelectorMap.SelectedIndexChanged += new System.EventHandler(this.ComboBoxSelectorShip_SelectedIndexChanged);
|
||||||
|
//
|
||||||
// ButtonRemoveShip
|
// ButtonRemoveShip
|
||||||
//
|
//
|
||||||
this.ButtonRemoveShip.Location = new System.Drawing.Point(12, 358);
|
this.ButtonRemoveShip.Location = new System.Drawing.Point(6, 137);
|
||||||
this.ButtonRemoveShip.Name = "ButtonRemoveShip";
|
this.ButtonRemoveShip.Name = "ButtonRemoveShip";
|
||||||
this.ButtonRemoveShip.Size = new System.Drawing.Size(176, 25);
|
this.ButtonRemoveShip.Size = new System.Drawing.Size(188, 25);
|
||||||
this.ButtonRemoveShip.TabIndex = 3;
|
this.ButtonRemoveShip.TabIndex = 3;
|
||||||
this.ButtonRemoveShip.Text = "Удалить корабль";
|
this.ButtonRemoveShip.Text = "Удалить корабль";
|
||||||
this.ButtonRemoveShip.UseVisualStyleBackColor = true;
|
this.ButtonRemoveShip.UseVisualStyleBackColor = true;
|
||||||
this.ButtonRemoveShip.Click += new System.EventHandler(this.ButtonRemoveShip_Click);
|
this.ButtonRemoveShip.Click += new System.EventHandler(this.ButtonRemoveShip_Click);
|
||||||
//
|
//
|
||||||
|
// ButtonAddShip
|
||||||
|
//
|
||||||
|
this.ButtonAddShip.Location = new System.Drawing.Point(6, 61);
|
||||||
|
this.ButtonAddShip.Name = "ButtonAddShip";
|
||||||
|
this.ButtonAddShip.Size = new System.Drawing.Size(188, 25);
|
||||||
|
this.ButtonAddShip.TabIndex = 2;
|
||||||
|
this.ButtonAddShip.Text = "Добавить корабль";
|
||||||
|
this.ButtonAddShip.UseVisualStyleBackColor = true;
|
||||||
|
this.ButtonAddShip.Click += new System.EventHandler(this.ButtonAddShip_Click);
|
||||||
|
//
|
||||||
// pictureBox1
|
// pictureBox1
|
||||||
//
|
//
|
||||||
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
|
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
|
||||||
this.pictureBox1.Name = "pictureBox1";
|
this.pictureBox1.Name = "pictureBox1";
|
||||||
this.pictureBox1.Size = new System.Drawing.Size(593, 582);
|
this.pictureBox1.Size = new System.Drawing.Size(600, 450);
|
||||||
this.pictureBox1.TabIndex = 0;
|
this.pictureBox1.TabIndex = 0;
|
||||||
this.pictureBox1.TabStop = false;
|
this.pictureBox1.TabStop = false;
|
||||||
//
|
//
|
||||||
@ -240,15 +180,13 @@
|
|||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(793, 582);
|
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||||
this.Controls.Add(this.pictureBox1);
|
this.Controls.Add(this.pictureBox1);
|
||||||
this.Controls.Add(this.groupBox1);
|
this.Controls.Add(this.groupBox1);
|
||||||
this.Name = "FormMapWithSetWarmlyShip";
|
this.Name = "FormMapWithSetWarmlyShip";
|
||||||
this.Text = "FormMapWithSetWarmlyShip";
|
this.Text = "FormMapWithSetWarmlyShip";
|
||||||
this.groupBox1.ResumeLayout(false);
|
this.groupBox1.ResumeLayout(false);
|
||||||
this.groupBox1.PerformLayout();
|
this.groupBox1.PerformLayout();
|
||||||
this.groupBoxMaps.ResumeLayout(false);
|
|
||||||
this.groupBoxMaps.PerformLayout();
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
@ -268,10 +206,5 @@
|
|||||||
private Button buttonUp;
|
private Button buttonUp;
|
||||||
private Button buttonRight;
|
private Button buttonRight;
|
||||||
private Button buttonLeft;
|
private Button buttonLeft;
|
||||||
private GroupBox groupBoxMaps;
|
|
||||||
private ListBox listBoxMaps;
|
|
||||||
private Button buttonDeleteMap;
|
|
||||||
private Button buttonAddMap;
|
|
||||||
private TextBox textBoxNewMapName;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -14,134 +14,45 @@ namespace WarmlyShip
|
|||||||
public partial class FormMapWithSetWarmlyShip : Form
|
public partial class FormMapWithSetWarmlyShip : Form
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Словарь для выпадающего списка
|
/// Объект от класса карты с набором объектов
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly Dictionary<string, AbstractMap> _mapsDict = new()
|
private MapWithSetWarmlyShipGeneric<DrawningObjectShip, AbstractMap> _mapWarmlyShipCollectionGeneric;
|
||||||
{
|
|
||||||
{ "Простая карта", new SimpleMap() },
|
|
||||||
{ "Море", new MyMap() }
|
|
||||||
};
|
|
||||||
/// <summary>
|
|
||||||
/// Объект от коллекции карт
|
|
||||||
/// </summary>
|
|
||||||
private readonly MapsCollection _mapsCollection;
|
|
||||||
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// Объект от класса карты с набором объектов
|
|
||||||
///// </summary>
|
|
||||||
//private MapWithSetWarmlyShipGeneric<DrawningObjectShip, AbstractMap> _mapWarmlyShipCollectionGeneric;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Конструктор
|
/// Конструктор
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public FormMapWithSetWarmlyShip()
|
public FormMapWithSetWarmlyShip()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_mapsCollection = new MapsCollection(pictureBox1.Width, pictureBox1.Height);
|
|
||||||
comboBoxSelectorMap.Items.Clear();
|
|
||||||
foreach (var elem in _mapsDict)
|
|
||||||
{
|
|
||||||
comboBoxSelectorMap.Items.Add(elem.Key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Заполнение listBoxMaps
|
|
||||||
/// </summary>
|
|
||||||
private void ReloadMaps()
|
|
||||||
{
|
|
||||||
int index = listBoxMaps.SelectedIndex;
|
|
||||||
listBoxMaps.Items.Clear();
|
|
||||||
for (int i = 0; i < _mapsCollection.Keys.Count; i++)
|
|
||||||
{
|
|
||||||
listBoxMaps.Items.Add(_mapsCollection.Keys[i]);
|
|
||||||
}
|
|
||||||
if (listBoxMaps.Items.Count > 0 && (index == -1 || index >= listBoxMaps.Items.Count))
|
|
||||||
{
|
|
||||||
listBoxMaps.SelectedIndex = 0;
|
|
||||||
}
|
|
||||||
else if (listBoxMaps.Items.Count > 0 && index > -1 && index < listBoxMaps.Items.Count)
|
|
||||||
{
|
|
||||||
listBoxMaps.SelectedIndex = index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Добавление карты
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void ButtonAddMap_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (comboBoxSelectorMap.SelectedIndex == -1 || string.IsNullOrEmpty(textBoxNewMapName.Text))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Не все данные заполнены", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!_mapsDict.ContainsKey(comboBoxSelectorMap.Text))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Нет такой карты", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_mapsCollection.AddMap(textBoxNewMapName.Text, _mapsDict[comboBoxSelectorMap.Text]);
|
|
||||||
ReloadMaps();
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Выбор карты
|
/// Выбор карты
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void ListBoxMaps_SelectedIndexChanged(object sender, EventArgs e)
|
private void ComboBoxSelectorShip_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
pictureBox1.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
AbstractMap map = null;
|
||||||
|
switch (comboBoxSelectorMap.Text)
|
||||||
|
{
|
||||||
|
case "Простая карта":
|
||||||
|
map = new SimpleMap();
|
||||||
|
break;
|
||||||
|
case "Море":
|
||||||
|
map = new MyMap();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (map != null)
|
||||||
|
{
|
||||||
|
_mapWarmlyShipCollectionGeneric = new MapWithSetWarmlyShipGeneric<DrawningObjectShip, AbstractMap>(
|
||||||
|
pictureBox1.Width, pictureBox1.Height, map);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_mapWarmlyShipCollectionGeneric = null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// Выбор карты
|
|
||||||
///// </summary>
|
|
||||||
///// <param name="sender"></param>
|
|
||||||
///// <param name="e"></param>
|
|
||||||
//private void ComboBoxSelectorShip_SelectedIndexChanged(object sender, EventArgs e)
|
|
||||||
//{
|
|
||||||
// AbstractMap map = null;
|
|
||||||
// switch (comboBoxSelectorMap.Text)
|
|
||||||
// {
|
|
||||||
// case "Простая карта":
|
|
||||||
// map = new SimpleMap();
|
|
||||||
// break;
|
|
||||||
// case "Море":
|
|
||||||
// map = new MyMap();
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// if (map != null)
|
|
||||||
// {
|
|
||||||
// _mapWarmlyShipCollectionGeneric = new MapWithSetWarmlyShipGeneric<DrawningObjectShip, AbstractMap>(
|
|
||||||
// pictureBox1.Width, pictureBox1.Height, map);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// _mapWarmlyShipCollectionGeneric = null;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Удаление карты
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void ButtonDeleteMap_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (listBoxMaps.SelectedIndex == -1)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (MessageBox.Show($"Удалить карту {listBoxMaps.SelectedItem}?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
|
||||||
{
|
|
||||||
_mapsCollection.DelMap(listBoxMaps.SelectedItem?.ToString() ?? string.Empty);
|
|
||||||
ReloadMaps();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Добавление объекта
|
/// Добавление объекта
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -149,18 +60,18 @@ namespace WarmlyShip
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void ButtonAddShip_Click(object sender, EventArgs e)
|
private void ButtonAddShip_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (listBoxMaps.SelectedIndex == -1)
|
if (_mapWarmlyShipCollectionGeneric == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
FormShip form = new();
|
FormShip form = new();
|
||||||
if (form.ShowDialog() == DialogResult.OK)
|
if (form.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
DrawningObjectShip ship = new(form.SelectedShip);
|
DrawningObjectShip car = new(form.SelectedShip);
|
||||||
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + ship!=null)
|
if ((_mapWarmlyShipCollectionGeneric + car) > -1)
|
||||||
{
|
{
|
||||||
MessageBox.Show("Объект добавлен");
|
MessageBox.Show("Объект добавлен");
|
||||||
pictureBox1.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
pictureBox1.Image = _mapWarmlyShipCollectionGeneric.ShowSet();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -177,10 +88,6 @@ namespace WarmlyShip
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void ButtonRemoveShip_Click(object sender, EventArgs e)
|
private void ButtonRemoveShip_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (listBoxMaps.SelectedIndex == -1)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (string.IsNullOrEmpty(maskedTextBoxPosition.Text))
|
if (string.IsNullOrEmpty(maskedTextBoxPosition.Text))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -191,10 +98,10 @@ namespace WarmlyShip
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int pos = Convert.ToInt32(maskedTextBoxPosition.Text);
|
int pos = Convert.ToInt32(maskedTextBoxPosition.Text);
|
||||||
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] - pos != null)
|
if ((_mapWarmlyShipCollectionGeneric - pos) != null)
|
||||||
{
|
{
|
||||||
MessageBox.Show("Объект удален");
|
MessageBox.Show("Объект удален");
|
||||||
pictureBox1.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet(); ;
|
pictureBox1.Image = _mapWarmlyShipCollectionGeneric.ShowSet();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -209,11 +116,11 @@ namespace WarmlyShip
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void ButtonShowStorage_Click(object sender, EventArgs e)
|
private void ButtonShowStorage_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (listBoxMaps.SelectedIndex == -1)
|
if (_mapWarmlyShipCollectionGeneric == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pictureBox1.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
pictureBox1.Image = _mapWarmlyShipCollectionGeneric.ShowSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -223,11 +130,11 @@ namespace WarmlyShip
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void ButtonShowOnMap_Click(object sender, EventArgs e)
|
private void ButtonShowOnMap_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (listBoxMaps.SelectedIndex == -1)
|
if (_mapWarmlyShipCollectionGeneric == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pictureBox1.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowOnMap();
|
pictureBox1.Image = _mapWarmlyShipCollectionGeneric.ShowOnMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -237,7 +144,7 @@ namespace WarmlyShip
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void ButtonMove_Click(object sender, EventArgs e)
|
private void ButtonMove_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (listBoxMaps.SelectedIndex == -1)
|
if (_mapWarmlyShipCollectionGeneric == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -260,7 +167,9 @@ namespace WarmlyShip
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pictureBox1.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].MoveObject(dir);
|
pictureBox1.Image = _mapWarmlyShipCollectionGeneric.MoveObject(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,11 +93,14 @@ namespace WarmlyShip
|
|||||||
public Bitmap ShowOnMap()
|
public Bitmap ShowOnMap()
|
||||||
{
|
{
|
||||||
Shaking();
|
Shaking();
|
||||||
foreach (var ship in _setWarmlyShip.GetShip())
|
for (int i = 0; i < _setWarmlyShip.Count; i++)
|
||||||
{
|
{
|
||||||
return _map.CreateMap(_pictureWidth, _pictureHeight, ship);
|
var car = _setWarmlyShip.Get(i);
|
||||||
|
if (car != null)
|
||||||
|
{
|
||||||
|
return _map.CreateMap(_pictureWidth, _pictureHeight, car);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new(_pictureWidth, _pictureHeight);
|
return new(_pictureWidth, _pictureHeight);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -121,11 +124,11 @@ namespace WarmlyShip
|
|||||||
int j = _setWarmlyShip.Count - 1;
|
int j = _setWarmlyShip.Count - 1;
|
||||||
for (int i = 0; i < _setWarmlyShip.Count; i++)
|
for (int i = 0; i < _setWarmlyShip.Count; i++)
|
||||||
{
|
{
|
||||||
if (_setWarmlyShip[i] == null)
|
if (_setWarmlyShip.Get(i) == null)
|
||||||
{
|
{
|
||||||
for (; j > i; j--)
|
for (; j > i; j--)
|
||||||
{
|
{
|
||||||
var car = _setWarmlyShip[j];
|
var car = _setWarmlyShip.Get(j);
|
||||||
if (car != null)
|
if (car != null)
|
||||||
{
|
{
|
||||||
_setWarmlyShip.Insert(car, i);
|
_setWarmlyShip.Insert(car, i);
|
||||||
@ -164,12 +167,23 @@ namespace WarmlyShip
|
|||||||
/// <param name="g"></param>
|
/// <param name="g"></param>
|
||||||
private void DrawWarmlyShip(Graphics g)
|
private void DrawWarmlyShip(Graphics g)
|
||||||
{
|
{
|
||||||
foreach (var ship in _setWarmlyShip.GetShip())
|
int i = 0;
|
||||||
|
int j = 0;
|
||||||
|
for (int k = 0; k < _setWarmlyShip.Count; k++)
|
||||||
{
|
{
|
||||||
// TODO установка позиции
|
_setWarmlyShip.Get(k)?.SetObject(j + 10, i + 20, _pictureWidth, _pictureHeight);
|
||||||
ship.DrawningObject(g);
|
_setWarmlyShip.Get(k)?.DrawningObject(g);
|
||||||
|
|
||||||
|
if (j >= _pictureWidth - 2 * _placeSizeWidth)
|
||||||
|
{
|
||||||
|
j = 0;
|
||||||
|
i += _placeSizeHeight;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
j += _placeSizeWidth;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,71 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace WarmlyShip
|
|
||||||
{
|
|
||||||
internal class MapsCollection
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Словарь (хранилище) с картами
|
|
||||||
/// </summary>
|
|
||||||
readonly Dictionary<string, MapWithSetWarmlyShipGeneric<DrawningObjectShip, AbstractMap>> _mapStorages;
|
|
||||||
/// <summary>
|
|
||||||
/// Возвращение списка названий карт
|
|
||||||
/// </summary>
|
|
||||||
public List<string> Keys => _mapStorages.Keys.ToList();
|
|
||||||
/// <summary>
|
|
||||||
/// /// Ширина окна отрисовки
|
|
||||||
/// </summary>
|
|
||||||
private readonly int _pictureWidth;
|
|
||||||
/// <summary>
|
|
||||||
/// Высота окна отрисовки
|
|
||||||
/// </summary>
|
|
||||||
private readonly int _pictureHeight;
|
|
||||||
/// <summary>
|
|
||||||
/// Конструктор
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pictureWidth"></param>
|
|
||||||
/// <param name="pictureHeight"></param>
|
|
||||||
public MapsCollection(int pictureWidth, int pictureHeight)
|
|
||||||
{
|
|
||||||
_mapStorages = new Dictionary<string, MapWithSetWarmlyShipGeneric<DrawningObjectShip, AbstractMap>>();
|
|
||||||
_pictureWidth = pictureWidth;
|
|
||||||
_pictureHeight = pictureHeight;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Добавление карты
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="name">Название карты</param>
|
|
||||||
/// <param name="map">Карта</param>
|
|
||||||
public void AddMap(string name, AbstractMap map)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Удаление карты
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="name">Название карты</param>
|
|
||||||
public void DelMap(string name)
|
|
||||||
{
|
|
||||||
// TODO Прописать логику для удаления
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Доступ к парковке
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="ind"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public MapWithSetWarmlyShipGeneric<DrawningObjectShip, AbstractMap> this[string
|
|
||||||
ind]
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
// TODO Продумать логику получения объекта
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -14,23 +14,20 @@ namespace WarmlyShip
|
|||||||
where T : class
|
where T : class
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Список объектов, которые храним
|
/// Массив объектов, которые храним
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly List<T> _places;
|
private readonly T[] _places;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Количество объектов в списке
|
/// Количество объектов в массиве
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Count => _places.Count;
|
public int Count => _places.Length;
|
||||||
|
|
||||||
private readonly int _maxCount;
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Конструктор
|
/// Конструктор
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="count"></param>
|
/// <param name="count"></param>
|
||||||
public SetWarmlyShipGeneric(int count)
|
public SetWarmlyShipGeneric(int count)
|
||||||
{
|
{
|
||||||
_maxCount = count;
|
_places = new T[count];
|
||||||
_places = new List<T>();
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Добавление объекта в набор
|
/// Добавление объекта в набор
|
||||||
@ -39,8 +36,6 @@ namespace WarmlyShip
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int Insert(T ship)
|
public int Insert(T ship)
|
||||||
{
|
{
|
||||||
// + проверка на _maxCount
|
|
||||||
|
|
||||||
if (ship == null)
|
if (ship == null)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
@ -60,7 +55,6 @@ namespace WarmlyShip
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int Insert(T ship, int position)
|
public int Insert(T ship, int position)
|
||||||
{
|
{
|
||||||
//кое что убрать (проверка позиции)
|
|
||||||
if (position < 0 || position > Count)
|
if (position < 0 || position > Count)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
@ -89,7 +83,6 @@ namespace WarmlyShip
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public T Remove(int position)
|
public T Remove(int position)
|
||||||
{
|
{
|
||||||
// убрать удаление объекта
|
|
||||||
if (_places[position] == null)
|
if (_places[position] == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@ -103,36 +96,13 @@ namespace WarmlyShip
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="position"></param>
|
/// <param name="position"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public T this[int position]
|
public T Get(int position)
|
||||||
{
|
{
|
||||||
get
|
if (_places[position] != null)
|
||||||
{
|
{
|
||||||
// TODO проверка позиции
|
|
||||||
return _places[position];
|
return _places[position];
|
||||||
}
|
}
|
||||||
set
|
return null;
|
||||||
{
|
|
||||||
// TODO проверка позиции
|
|
||||||
// TODO вставка в список по позиции
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Проход по набору до первого пустого
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public IEnumerable<T> GetShip()
|
|
||||||
{
|
|
||||||
foreach (var ship in _places)
|
|
||||||
{
|
|
||||||
if (ship != null)
|
|
||||||
{
|
|
||||||
yield return ship;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
yield break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user