новая форма
This commit is contained in:
parent
fa9a16f4f4
commit
b05fca00fe
19
Battleship/Battleship/FormBattleship.Designer.cs
generated
19
Battleship/Battleship/FormBattleship.Designer.cs
generated
@ -37,6 +37,7 @@
|
|||||||
this.buttonCreateAdd = new System.Windows.Forms.Button();
|
this.buttonCreateAdd = new System.Windows.Forms.Button();
|
||||||
this.buttonStep = new System.Windows.Forms.Button();
|
this.buttonStep = new System.Windows.Forms.Button();
|
||||||
this.comboBoxStrategy = new System.Windows.Forms.ComboBox();
|
this.comboBoxStrategy = new System.Windows.Forms.ComboBox();
|
||||||
|
this.buttonSelectShip = new System.Windows.Forms.Button();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxBattleship)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBoxBattleship)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
@ -142,11 +143,23 @@
|
|||||||
this.comboBoxStrategy.Size = new System.Drawing.Size(121, 23);
|
this.comboBoxStrategy.Size = new System.Drawing.Size(121, 23);
|
||||||
this.comboBoxStrategy.TabIndex = 13;
|
this.comboBoxStrategy.TabIndex = 13;
|
||||||
//
|
//
|
||||||
// Battleship
|
// buttonSelectShip
|
||||||
|
//
|
||||||
|
this.buttonSelectShip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.buttonSelectShip.Location = new System.Drawing.Point(297, 415);
|
||||||
|
this.buttonSelectShip.Name = "buttonSelectShip";
|
||||||
|
this.buttonSelectShip.Size = new System.Drawing.Size(118, 23);
|
||||||
|
this.buttonSelectShip.TabIndex = 14;
|
||||||
|
this.buttonSelectShip.Text = "Выбрать корабль";
|
||||||
|
this.buttonSelectShip.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonSelectShip.Click += new System.EventHandler(this.buttonSelectShip_Click);
|
||||||
|
//
|
||||||
|
// FormBattleship
|
||||||
//
|
//
|
||||||
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(800, 450);
|
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||||
|
this.Controls.Add(this.buttonSelectShip);
|
||||||
this.Controls.Add(this.comboBoxStrategy);
|
this.Controls.Add(this.comboBoxStrategy);
|
||||||
this.Controls.Add(this.buttonStep);
|
this.Controls.Add(this.buttonStep);
|
||||||
this.Controls.Add(this.buttonCreateAdd);
|
this.Controls.Add(this.buttonCreateAdd);
|
||||||
@ -156,9 +169,8 @@
|
|||||||
this.Controls.Add(this.buttonUp);
|
this.Controls.Add(this.buttonUp);
|
||||||
this.Controls.Add(this.buttonCreate);
|
this.Controls.Add(this.buttonCreate);
|
||||||
this.Controls.Add(this.pictureBoxBattleship);
|
this.Controls.Add(this.pictureBoxBattleship);
|
||||||
this.Name = "Battleship";
|
this.Name = "FormBattleship";
|
||||||
this.Text = "Form1";
|
this.Text = "Form1";
|
||||||
this.Load += new System.EventHandler(this.Battleship_Load);
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxBattleship)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBoxBattleship)).EndInit();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
@ -174,5 +186,6 @@
|
|||||||
private Button buttonCreateAdd;
|
private Button buttonCreateAdd;
|
||||||
private Button buttonStep;
|
private Button buttonStep;
|
||||||
private ComboBox comboBoxStrategy;
|
private ComboBox comboBoxStrategy;
|
||||||
|
private Button buttonSelectShip;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
using Battleship.DrawningObjects;
|
using Battleship.DrawningObjects;
|
||||||
using Battleship.MovementStrategy;
|
using Battleship.MovementStrategy;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
namespace Battleship
|
namespace Battleship
|
||||||
{
|
{
|
||||||
@ -13,9 +14,15 @@ namespace Battleship
|
|||||||
/// Èíèöèàëèçàöèÿ ôîðìû
|
/// Èíèöèàëèçàöèÿ ôîðìû
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private AbstractStrategy? _abstractStrategy;
|
private AbstractStrategy? _abstractStrategy;
|
||||||
|
/// <summary>
|
||||||
|
/// Âûáðàííûé êîðàáëü
|
||||||
|
/// </summary>
|
||||||
|
public DrawningShip? SelectedShip { get; private set; }
|
||||||
public FormBattleship()
|
public FormBattleship()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
_abstractStrategy = null;
|
||||||
|
SelectedShip = null;
|
||||||
}
|
}
|
||||||
/// Ìåòîä ïðîðèñîâêè
|
/// Ìåòîä ïðîðèñîâêè
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -31,31 +38,56 @@ namespace Battleship
|
|||||||
_drawningShip.DrawTransport(gr);
|
_drawningShip.DrawTransport(gr);
|
||||||
pictureBoxBattleship.Image = bmp;
|
pictureBoxBattleship.Image = bmp;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Îáðàáîòêà íàæàòèÿ êíîïêè "Ñîçäàòü ïðîñòîé êîðàáëü"
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
private void buttonCreate_Click(object sender, EventArgs e)
|
private void buttonCreate_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Random random = new();
|
Random random = new();
|
||||||
|
Color color = Color.FromArgb(random.Next(0, 256),
|
||||||
|
random.Next(0, 256), random.Next(0, 256));
|
||||||
|
ColorDialog dialog = new();
|
||||||
|
if (dialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
color = dialog.Color;
|
||||||
|
}
|
||||||
_drawningShip = new DrawningShip(random.Next(100, 300),
|
_drawningShip = new DrawningShip(random.Next(100, 300),
|
||||||
random.Next(1000, 3000),
|
random.Next(1000, 3000), color,
|
||||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256),
|
|
||||||
random.Next(0, 256)),
|
|
||||||
pictureBoxBattleship.Width, pictureBoxBattleship.Height);
|
pictureBoxBattleship.Width, pictureBoxBattleship.Height);
|
||||||
_drawningShip.SetPosition(random.Next(10, 100), random.Next(10, 100));
|
_drawningShip.SetPosition(random.Next(10, 100), random.Next(10,
|
||||||
|
100));
|
||||||
Draw();
|
Draw();
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Îáðàáîòêà íàæàòèÿ êíîïêè "Ñîçäàòü âîåííûé êîðàáëü"
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
private void buttonCreateAdd_Click(object sender, EventArgs e)
|
private void buttonCreateAdd_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Random random = new();
|
Random random = new();
|
||||||
|
Color bodyColor = Color.FromArgb(random.Next(0, 256),
|
||||||
|
random.Next(0, 256), random.Next(0, 256));
|
||||||
|
ColorDialog dialog = new();
|
||||||
|
if (dialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
bodyColor = dialog.Color;
|
||||||
|
}
|
||||||
|
Color addColor = Color.FromArgb(random.Next(0, 256),
|
||||||
|
random.Next(0, 256), random.Next(0, 256));
|
||||||
|
if (dialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
addColor = dialog.Color;
|
||||||
|
}
|
||||||
_drawningShip = new DrawningBattleship(random.Next(100, 300),
|
_drawningShip = new DrawningBattleship(random.Next(100, 300),
|
||||||
random.Next(1000, 3000),
|
random.Next(1000, 3000), bodyColor,
|
||||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256),
|
addColor,
|
||||||
random.Next(0, 256)),
|
|
||||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256),
|
|
||||||
random.Next(0, 256)),
|
|
||||||
Convert.ToBoolean(random.Next(0, 2)),
|
Convert.ToBoolean(random.Next(0, 2)),
|
||||||
Convert.ToBoolean(random.Next(0, 2)),
|
Convert.ToBoolean(random.Next(0, 2)),
|
||||||
pictureBoxBattleship.Width, pictureBoxBattleship.Height);
|
pictureBoxBattleship.Width, pictureBoxBattleship.Height);
|
||||||
_drawningShip.SetPosition(random.Next(10, 100), random.Next(10,100));
|
_drawningShip.SetPosition(random.Next(10, 100), random.Next(10, 100));
|
||||||
Draw();
|
Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,10 +152,10 @@ namespace Battleship
|
|||||||
_abstractStrategy = null;
|
_abstractStrategy = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private void buttonSelectShip_Click(object sender, EventArgs e)
|
||||||
private void Battleship_Load(object sender, EventArgs e)
|
|
||||||
{
|
{
|
||||||
|
SelectedShip = _drawningShip;
|
||||||
|
DialogResult = DialogResult.OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
129
Battleship/Battleship/FormShipCollection.Designer.cs
generated
Normal file
129
Battleship/Battleship/FormShipCollection.Designer.cs
generated
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
namespace Battleship
|
||||||
|
{
|
||||||
|
partial class FormShipCollection
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.groupBoxBattleShip = new System.Windows.Forms.GroupBox();
|
||||||
|
this.pictureBoxCollection = new System.Windows.Forms.PictureBox();
|
||||||
|
this.buttonAddShip = new System.Windows.Forms.Button();
|
||||||
|
this.buttonRemoveShip = new System.Windows.Forms.Button();
|
||||||
|
this.buttonRefreshCollection = new System.Windows.Forms.Button();
|
||||||
|
this.maskedTextBoxNumber = new System.Windows.Forms.TextBox();
|
||||||
|
this.groupBoxBattleShip.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCollection)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// groupBoxBattleShip
|
||||||
|
//
|
||||||
|
this.groupBoxBattleShip.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.groupBoxBattleShip.Controls.Add(this.maskedTextBoxNumber);
|
||||||
|
this.groupBoxBattleShip.Controls.Add(this.buttonRefreshCollection);
|
||||||
|
this.groupBoxBattleShip.Controls.Add(this.buttonRemoveShip);
|
||||||
|
this.groupBoxBattleShip.Controls.Add(this.buttonAddShip);
|
||||||
|
this.groupBoxBattleShip.Location = new System.Drawing.Point(618, 1);
|
||||||
|
this.groupBoxBattleShip.Name = "groupBoxBattleShip";
|
||||||
|
this.groupBoxBattleShip.Size = new System.Drawing.Size(183, 450);
|
||||||
|
this.groupBoxBattleShip.TabIndex = 0;
|
||||||
|
this.groupBoxBattleShip.TabStop = false;
|
||||||
|
this.groupBoxBattleShip.Text = "Инструменты";
|
||||||
|
//
|
||||||
|
// pictureBoxCollection
|
||||||
|
//
|
||||||
|
this.pictureBoxCollection.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.pictureBoxCollection.Location = new System.Drawing.Point(-1, 1);
|
||||||
|
this.pictureBoxCollection.Name = "pictureBoxCollection";
|
||||||
|
this.pictureBoxCollection.Size = new System.Drawing.Size(613, 450);
|
||||||
|
this.pictureBoxCollection.TabIndex = 0;
|
||||||
|
this.pictureBoxCollection.TabStop = false;
|
||||||
|
//
|
||||||
|
// buttonAddShip
|
||||||
|
//
|
||||||
|
this.buttonAddShip.Location = new System.Drawing.Point(22, 22);
|
||||||
|
this.buttonAddShip.Name = "buttonAddShip";
|
||||||
|
this.buttonAddShip.Size = new System.Drawing.Size(147, 33);
|
||||||
|
this.buttonAddShip.TabIndex = 0;
|
||||||
|
this.buttonAddShip.Text = "Добавить корабль";
|
||||||
|
this.buttonAddShip.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonAddShip.Click += new System.EventHandler(this.buttonAddShip_Click);
|
||||||
|
//
|
||||||
|
// buttonRemoveShip
|
||||||
|
//
|
||||||
|
this.buttonRemoveShip.Location = new System.Drawing.Point(22, 217);
|
||||||
|
this.buttonRemoveShip.Name = "buttonRemoveShip";
|
||||||
|
this.buttonRemoveShip.Size = new System.Drawing.Size(147, 33);
|
||||||
|
this.buttonRemoveShip.TabIndex = 1;
|
||||||
|
this.buttonRemoveShip.Text = "Удалить корабль";
|
||||||
|
this.buttonRemoveShip.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonRemoveShip.Click += new System.EventHandler(this.buttonRemoveShip_Click);
|
||||||
|
//
|
||||||
|
// buttonRefreshCollection
|
||||||
|
//
|
||||||
|
this.buttonRefreshCollection.Location = new System.Drawing.Point(22, 265);
|
||||||
|
this.buttonRefreshCollection.Name = "buttonRefreshCollection";
|
||||||
|
this.buttonRefreshCollection.Size = new System.Drawing.Size(147, 33);
|
||||||
|
this.buttonRefreshCollection.TabIndex = 2;
|
||||||
|
this.buttonRefreshCollection.Text = "Обновить коллекцию";
|
||||||
|
this.buttonRefreshCollection.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonRefreshCollection.Click += new System.EventHandler(this.buttonRefreshCollection_Click);
|
||||||
|
//
|
||||||
|
// maskedTextBoxNumber
|
||||||
|
//
|
||||||
|
this.maskedTextBoxNumber.Location = new System.Drawing.Point(22, 166);
|
||||||
|
this.maskedTextBoxNumber.Name = "maskedTextBoxNumber";
|
||||||
|
this.maskedTextBoxNumber.Size = new System.Drawing.Size(147, 23);
|
||||||
|
this.maskedTextBoxNumber.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// FormShipCollection
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||||
|
this.Controls.Add(this.pictureBoxCollection);
|
||||||
|
this.Controls.Add(this.groupBoxBattleShip);
|
||||||
|
this.Name = "FormShipCollection";
|
||||||
|
this.Text = "FormShipCollection";
|
||||||
|
this.groupBoxBattleShip.ResumeLayout(false);
|
||||||
|
this.groupBoxBattleShip.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCollection)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private GroupBox groupBoxBattleShip;
|
||||||
|
private TextBox maskedTextBoxNumber;
|
||||||
|
private Button buttonRefreshCollection;
|
||||||
|
private Button buttonRemoveShip;
|
||||||
|
private Button buttonAddShip;
|
||||||
|
private PictureBox pictureBoxCollection;
|
||||||
|
}
|
||||||
|
}
|
76
Battleship/Battleship/FormShipCollection.cs
Normal file
76
Battleship/Battleship/FormShipCollection.cs
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
using Battleship.DrawningObjects;
|
||||||
|
using Battleship.Generics;
|
||||||
|
using Battleship.MovementStrategy;
|
||||||
|
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;
|
||||||
|
|
||||||
|
namespace Battleship
|
||||||
|
{
|
||||||
|
public partial class FormShipCollection : Form
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Набор объектов
|
||||||
|
/// </summary>
|
||||||
|
private readonly ShipGenericCollection<DrawningShip,DrawningObjectShip> _ships;
|
||||||
|
/// <summary>
|
||||||
|
/// Конструктор
|
||||||
|
/// </summary>
|
||||||
|
public FormShipCollection()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_ships = new ShipGenericCollection<DrawningShip, DrawningObjectShip>(pictureBoxCollection.Width, pictureBoxCollection.Height);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Добавление объекта в набор
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void buttonAddShip_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
FormBattleship form = new();
|
||||||
|
if (form.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
if (_ships + form.SelectedShip)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Объект добавлен");
|
||||||
|
pictureBoxCollection.Image = _ships.ShowShips();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Не удалось добавить объект");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonRemoveShip_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show("Удалить объект?", "Удаление",
|
||||||
|
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int pos = Convert.ToInt32(maskedTextBoxNumber.Text);
|
||||||
|
if (_ships - pos != null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Объект удален");
|
||||||
|
pictureBoxCollection.Image = _ships.ShowShips();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Не удалось удалить объект");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonRefreshCollection_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
pictureBoxCollection.Image = _ships.ShowShips();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
60
Battleship/Battleship/FormShipCollection.resx
Normal file
60
Battleship/Battleship/FormShipCollection.resx
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<root>
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
@ -11,7 +11,7 @@ namespace Battleship
|
|||||||
// To customize application configuration such as set high DPI settings or default font,
|
// To customize application configuration such as set high DPI settings or default font,
|
||||||
// see https://aka.ms/applicationconfiguration.
|
// see https://aka.ms/applicationconfiguration.
|
||||||
ApplicationConfiguration.Initialize();
|
ApplicationConfiguration.Initialize();
|
||||||
Application.Run(new FormBattleship());
|
Application.Run(new FormShipCollection());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -36,11 +36,11 @@ namespace Battleship.Generics
|
|||||||
public static bool operator -(ShipGenericCollection<T, U>? collect, int pos)
|
public static bool operator -(ShipGenericCollection<T, U>? collect, int pos)
|
||||||
{
|
{
|
||||||
T? obj = collect?._collection.Get(pos);
|
T? obj = collect?._collection.Get(pos);
|
||||||
if (obj != null)
|
if (obj != null && collect != null)
|
||||||
{
|
{
|
||||||
collect._collection.Remove(pos);
|
return collect._collection.Remove(pos);
|
||||||
}
|
}
|
||||||
return obj;
|
return false;
|
||||||
}
|
}
|
||||||
public U? GetU(int pos)
|
public U? GetU(int pos)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user