Третий этап Lab8

This commit is contained in:
Максим Егоров 2024-10-06 20:46:58 +04:00
parent dcb622b7d5
commit 3b2f788d4f
5 changed files with 46 additions and 136 deletions

View File

@ -13,10 +13,6 @@ namespace Sailboat.Entities
public Color BodyColor { get; private set; } public Color BodyColor { get; private set; }
public void setBodyColor(Color color) { BodyColor = color; } public void setBodyColor(Color color) { BodyColor = color; }
public double Step => (double)Speed * 100 / Weight; public double Step => (double)Speed * 100 / Weight;
public void ChangeColor(Color color)
{
BodyColor = color;
}
/// <summary> /// <summary>
/// Конструктор с параметрами /// Конструктор с параметрами

View File

@ -12,10 +12,6 @@ namespace Sailboat.Entities
public void setAdditionalColor(Color color) { AdditionalColor = color; } public void setAdditionalColor(Color color) { AdditionalColor = color; }
public bool Hull { get; private set; } public bool Hull { get; private set; }
public bool Sail { get; private set; } public bool Sail { get; private set; }
public void ChangeAddColor(Color color)
{
AdditionalColor = color;
}
/// <summary> /// <summary>
/// Инициализация полей объекта-класса парусной лодки /// Инициализация полей объекта-класса парусной лодки

View File

@ -183,7 +183,6 @@ namespace Sailboat
menuStrip.Padding = new Padding(5, 2, 0, 2); menuStrip.Padding = new Padding(5, 2, 0, 2);
menuStrip.Size = new Size(183, 24); menuStrip.Size = new Size(183, 24);
menuStrip.TabIndex = 5; menuStrip.TabIndex = 5;
this.menuStrip.TabIndex = 5;
// //
// toolStripMenuItem1 // toolStripMenuItem1
// //
@ -196,8 +195,7 @@ namespace Sailboat
ToolStripMenuItem.Name = "ToolStripMenuItem"; ToolStripMenuItem.Name = "ToolStripMenuItem";
ToolStripMenuItem.Size = new Size(48, 20); ToolStripMenuItem.Size = new Size(48, 20);
ToolStripMenuItem.Text = "Файл"; ToolStripMenuItem.Text = "Файл";
this.ToolStripMenuItem.Size = new System.Drawing.Size(59, 24); ToolStripMenuItem.Size = new System.Drawing.Size(59, 24);
this.ToolStripMenuItem.Text = "Файл";
// //
// SaveToolStripMenuItem // SaveToolStripMenuItem
// //
@ -224,23 +222,23 @@ namespace Sailboat
// //
// buttonSortByType // buttonSortByType
// //
this.buttonSortByType.Location = new System.Drawing.Point(20, 448); buttonSortByType.Location = new System.Drawing.Point(20, 348);
this.buttonSortByType.Name = "buttonSortByType"; buttonSortByType.Name = "buttonSortByType";
this.buttonSortByType.Size = new System.Drawing.Size(180, 34); buttonSortByType.Size = new System.Drawing.Size(180, 34);
this.buttonSortByType.TabIndex = 6; buttonSortByType.TabIndex = 6;
this.buttonSortByType.Text = "Сортировать по типу"; buttonSortByType.Text = "Сортировать по типу";
this.buttonSortByType.UseVisualStyleBackColor = true; buttonSortByType.UseVisualStyleBackColor = true;
this.buttonSortByType.Click += new System.EventHandler(this.buttonSortByType_Click); buttonSortByType.Click += new System.EventHandler(this.buttonSortByType_Click);
// //
// buttonSortByColor // buttonSortByColor
// //
this.buttonSortByColor.Location = new System.Drawing.Point(20, 488); buttonSortByColor.Location = new System.Drawing.Point(20, 488);
this.buttonSortByColor.Name = "buttonSortByColor"; buttonSortByColor.Name = "buttonSortByColor";
this.buttonSortByColor.Size = new System.Drawing.Size(180, 34); buttonSortByColor.Size = new System.Drawing.Size(180, 34);
this.buttonSortByColor.TabIndex = 7; buttonSortByColor.TabIndex = 7;
this.buttonSortByColor.Text = "Сортировать по цвету"; buttonSortByColor.Text = "Сортировать по цвету";
this.buttonSortByColor.UseVisualStyleBackColor = true; buttonSortByColor.UseVisualStyleBackColor = true;
this.buttonSortByColor.Click += new System.EventHandler(this.buttonSortByColor_Click); buttonSortByColor.Click += new System.EventHandler(this.buttonSortByColor_Click);
// //
// FormBoatCollection // FormBoatCollection
// //

View File

@ -1,64 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <root>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
@ -117,4 +57,16 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>144, 0</value>
</metadata>
<metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>144, 0</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
</metadata>
</root> </root>

View File

@ -29,28 +29,17 @@
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormSailboat)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormSailboat));
this.pictureBoxSailboat = new System.Windows.Forms.PictureBox(); pictureBoxSailboat = new System.Windows.Forms.PictureBox();
this.buttonCreateBoat = new System.Windows.Forms.Button(); buttonCreateBoat = new System.Windows.Forms.Button();
this.buttonLeft = new System.Windows.Forms.Button(); buttonLeft = new System.Windows.Forms.Button();
this.buttonUp = new System.Windows.Forms.Button(); buttonUp = new System.Windows.Forms.Button();
this.buttonRight = new System.Windows.Forms.Button(); buttonRight = new System.Windows.Forms.Button();
this.buttonDown = new System.Windows.Forms.Button(); buttonDown = new System.Windows.Forms.Button();
this.buttonCreateSailboat = new System.Windows.Forms.Button(); buttonCreateSailboat = new System.Windows.Forms.Button();
this.comboBoxStrategy = new System.Windows.Forms.ComboBox(); comboBoxStrategy = new System.Windows.Forms.ComboBox();
this.buttonStep = new System.Windows.Forms.Button(); buttonStep = new System.Windows.Forms.Button();
this.buttonSelectBoat = new System.Windows.Forms.Button(); buttonSelectBoat = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxSailboat)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(pictureBoxSailboat)).BeginInit();
this.SuspendLayout();
pictureBoxSailboat = new PictureBox();
buttonCreateBoat = new Button();
buttonLeft = new Button();
buttonUp = new Button();
buttonRight = new Button();
buttonDown = new Button();
buttonCreateSailboat = new Button();
comboBoxStrategy = new ComboBox();
buttonStep = new Button();
((System.ComponentModel.ISupportInitialize)pictureBoxSailboat).BeginInit();
SuspendLayout(); SuspendLayout();
// //
// pictureBoxSailboat // pictureBoxSailboat
@ -166,37 +155,16 @@
// //
// buttonSelectBoat // buttonSelectBoat
// //
this.buttonSelectBoat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); buttonSelectBoat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonSelectBoat.Location = new System.Drawing.Point(688, 97); buttonSelectBoat.Location = new System.Drawing.Point(688, 97);
this.buttonSelectBoat.Name = "buttonSelectBoat"; buttonSelectBoat.Name = "buttonSelectBoat";
this.buttonSelectBoat.Size = new System.Drawing.Size(149, 33); buttonSelectBoat.Size = new System.Drawing.Size(149, 33);
this.buttonSelectBoat.TabIndex = 9; buttonSelectBoat.TabIndex = 9;
this.buttonSelectBoat.Text = "Выбрать лодку"; buttonSelectBoat.Text = "Выбрать лодку";
this.buttonSelectBoat.UseVisualStyleBackColor = true; buttonSelectBoat.UseVisualStyleBackColor = true;
this.buttonSelectBoat.Click += new System.EventHandler(this.buttonSelectBoat_Click);
// //
// FormSailboat // FormSailboat
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(882, 453);
this.Controls.Add(this.buttonSelectBoat);
this.Controls.Add(this.buttonStep);
this.Controls.Add(this.comboBoxStrategy);
this.Controls.Add(this.buttonCreateSailboat);
this.Controls.Add(this.buttonDown);
this.Controls.Add(this.buttonRight);
this.Controls.Add(this.buttonUp);
this.Controls.Add(this.buttonLeft);
this.Controls.Add(this.buttonCreateBoat);
this.Controls.Add(this.pictureBoxSailboat);
this.Name = "FormSailboat";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Парусник";
((System.ComponentModel.ISupportInitialize)(this.pictureBoxSailboat)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(834, 461); ClientSize = new Size(834, 461);