From 71b1caa094fd8750feeca552f755bb7ae8d0a36c Mon Sep 17 00:00:00 2001 From: "safiulova.k" Date: Wed, 22 Nov 2023 02:44:28 +0400 Subject: [PATCH 1/4] =?UTF-8?q?=D0=BF=D0=BE=D1=87=D1=82=D0=B8=206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Catamaran/CatamaransGenericCollection.cs | 4 + .../Catamaran/CatamaransGenericStorage.cs | 106 +++++++++++++++++- .../Catamaran/ExtentionDrawningCatamaran.cs | 66 +++++++++++ .../Catamaran/FormCatamaranCollection.cs | 44 +++++++- .../Catamaran/FormCatamaranCollection.resx | 12 ++ 5 files changed, 230 insertions(+), 2 deletions(-) create mode 100644 base/Catamaran/Catamaran/ExtentionDrawningCatamaran.cs diff --git a/base/Catamaran/Catamaran/CatamaransGenericCollection.cs b/base/Catamaran/Catamaran/CatamaransGenericCollection.cs index f421270..cd3a487 100644 --- a/base/Catamaran/Catamaran/CatamaransGenericCollection.cs +++ b/base/Catamaran/Catamaran/CatamaransGenericCollection.cs @@ -38,6 +38,10 @@ namespace Catamaran.Generics /// private readonly SetGeneric _collection; /// + /// Получение объектов коллекции + /// + public IEnumerable GetCatamarans => _collection.GetCatamarans(); + /// /// Конструктор /// /// diff --git a/base/Catamaran/Catamaran/CatamaransGenericStorage.cs b/base/Catamaran/Catamaran/CatamaransGenericStorage.cs index 39c92da..ddf2151 100644 --- a/base/Catamaran/Catamaran/CatamaransGenericStorage.cs +++ b/base/Catamaran/Catamaran/CatamaransGenericStorage.cs @@ -1,5 +1,7 @@ using Catamaran.DrawningObjects; using Catamaran.MovementStrategy; +using System.Text; + namespace Catamaran.Generics { /// @@ -25,6 +27,18 @@ namespace Catamaran.Generics /// private readonly int _pictureHeight; /// + /// Разделитель для записи ключа и значения элемента словаря + /// + private static readonly char _separatorForKeyValue = '|'; + /// + /// Разделитель для записей коллекции данных в файл + /// + private readonly char _separatorRecords = ';'; + /// + /// Разделитель для записи информации по объекту в файл + /// + private static readonly char _separatorForObject = ':'; + /// /// Конструктор /// /// @@ -73,5 +87,95 @@ namespace Catamaran.Generics return null; } } + /// + /// Сохранение информации по катамаранам в хранилище в файл + /// + /// Путь и имя файла + /// true - сохранение прошло успешно, false - ошибка при сохранении данных + public bool SaveData(string filename) + { + if (File.Exists(filename)) + { + File.Delete(filename); + } + StringBuilder data = new(); + foreach (KeyValuePair> record in _catamaranStorages) + { + StringBuilder records = new(); + foreach (DrawningCatamaran? elem in record.Value.GetCatamarans) + { + records.Append($"{elem?.GetDataForSave(_separatorForObject)}{_separatorRecords}"); + } + data.AppendLine($"{record.Key}{_separatorForKeyValue}{records}"); + } + if (data.Length == 0) + { + return false; + } + using FileStream fs = new(filename, FileMode.Create); + byte[] info = new + UTF8Encoding(true).GetBytes($"CatamaranStorage{Environment.NewLine}{data}"); + fs.Write(info, 0, info.Length); + return true; + } + /// + /// Загрузка информации по катамаранам в хранилище из файла + /// + /// Путь и имя файла + /// true - загрузка прошла успешно, false - ошибка призагрузке данных + public bool LoadData(string filename) + { + if (!File.Exists(filename)) + { + return false; + } + string bufferTextFromFile = ""; + using (FileStream fs = new(filename, FileMode.Open)) + { + byte[] b = new byte[fs.Length]; + UTF8Encoding temp = new(true); + while (fs.Read(b, 0, b.Length) > 0) + { + bufferTextFromFile += temp.GetString(b); + } + } + var strs = bufferTextFromFile.Split(new char[] { '\n', '\r' }, + StringSplitOptions.RemoveEmptyEntries); + if (strs == null || strs.Length == 0) + { + return false; + } + if (!strs[0].StartsWith("CatamaranStorage")) + { + //если нет такой записи, то это не те данные + return false; + } + _catamaranStorages.Clear(); + foreach (string data in strs) + { + string[] record = data.Split(_separatorForKeyValue, StringSplitOptions.RemoveEmptyEntries); + if (record.Length != 2) + { + continue; + } + CatamaransGenericCollection + collection = new(_pictureWidth, _pictureHeight); + string[] set = record[1].Split(_separatorRecords, + StringSplitOptions.RemoveEmptyEntries); + foreach (string elem in set) + { + DrawningCatamaran? catamaran = elem?.CreateDrawningCatamaran(_separatorForObject, _pictureWidth, _pictureHeight); + if (catamaran != null) + { + if (!(collection + catamaran)) + { + return false; + } + } + } + _catamaranStorages.Add(record[0], collection); + } + return true; + } } -} +} \ No newline at end of file diff --git a/base/Catamaran/Catamaran/ExtentionDrawningCatamaran.cs b/base/Catamaran/Catamaran/ExtentionDrawningCatamaran.cs new file mode 100644 index 0000000..836892c --- /dev/null +++ b/base/Catamaran/Catamaran/ExtentionDrawningCatamaran.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Catamaran.Entities; +namespace Catamaran.DrawningObjects +{ + /// + /// Расширение для класса EntityCatamaran + /// + public static class ExtentionDrawningCatamaran + { + /// + /// Создание объекта из строки + /// + /// Строка с данными для создания объекта + /// Разделитель даннных + /// Ширина + /// Высота + /// Объект + public static DrawningCatamaran? CreateDrawningCatamaran(this string info, char + separatorForObject, int width, int height) + { + string[] strs = info.Split(separatorForObject); + if (strs.Length == 3) + { + return new DrawningCatamaran(Convert.ToInt32(strs[0]), + Convert.ToInt32(strs[1]), Color.FromName(strs[2]), width, height); + } + if (strs.Length == 6) + { + return new DrawningSailCatamaran(Convert.ToInt32(strs[0]), + Convert.ToInt32(strs[1]), + Color.FromName(strs[2]), + Color.FromName(strs[3]), + Convert.ToBoolean(strs[4]), + Convert.ToBoolean(strs[5]), width, height); + } + return null; + } + /// + /// Получение данных для сохранения в файл + /// + /// Сохраняемый объект + /// Разделитель даннных + /// Строка с данными по объекту + public static string GetDataForSave(this DrawningCatamaran drawningCatamaran, + char separatorForObject) + { + var catamaran = drawningCatamaran.EntityCatamaran; + if (catamaran == null) + { + return string.Empty; + } + var str = $"{catamaran.Speed}{separatorForObject}{catamaran.Weight}{separatorForObject}{catamaran.BodyColor.Name}"; + if (catamaran is not EntitySailCatamaran sailCatamaran) + { + return str; + } + return + $"{str}{separatorForObject}{sailCatamaran.AdditionalColor.Name}{separatorForObject}{sailCatamaran.Sail}{separatorForObject}{sailCatamaran.FloatDetail}"; + } + } +} diff --git a/base/Catamaran/Catamaran/FormCatamaranCollection.cs b/base/Catamaran/Catamaran/FormCatamaranCollection.cs index 503a692..98d3ad4 100644 --- a/base/Catamaran/Catamaran/FormCatamaranCollection.cs +++ b/base/Catamaran/Catamaran/FormCatamaranCollection.cs @@ -192,7 +192,49 @@ namespace Catamaran return; } pictureBoxCollection.Image = obj.ShowCatamarans(); - + } + /// + /// Обработка нажатия "Сохранение" + /// + /// + /// + private void SaveToolStripMenuItem_Click(object sender, EventArgs e) + { + if (saveFileDialog.ShowDialog() == DialogResult.OK) + { + if (_storage.SaveData(saveFileDialog.FileName)) + { + MessageBox.Show("Сохранение прошло успешно", + "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + else + { + MessageBox.Show("Не сохранилось", "Результат", + MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + /// + /// Обработка нажатия "Загрузка" + /// + /// + /// + private void LoadToolStripMenuItem_Click(object sender, EventArgs e) + { + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + if (_storage.LoadData(openFileDialog.FileName)) + { + MessageBox.Show("Загрузка прошла успешно", + "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + else + { + MessageBox.Show("Не загрузилось", "Результат", + MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + ReloadObjects(); } } } diff --git a/base/Catamaran/Catamaran/FormCatamaranCollection.resx b/base/Catamaran/Catamaran/FormCatamaranCollection.resx index f298a7b..c8f11b0 100644 --- a/base/Catamaran/Catamaran/FormCatamaranCollection.resx +++ b/base/Catamaran/Catamaran/FormCatamaranCollection.resx @@ -57,4 +57,16 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + + + 125, 17 + + + 258, 17 + + + 154 + \ No newline at end of file -- 2.25.1 From c549fc6a3c8e61a5cccc7f5cae32f7abb820cc4f Mon Sep 17 00:00:00 2001 From: "safiulova.k" Date: Wed, 22 Nov 2023 10:49:19 +0400 Subject: [PATCH 2/4] laba6 --- .../Catamaran/CatamaransGenericCollection.cs | 2 + .../Catamaran/CatamaransGenericStorage.cs | 84 +++++++++---------- base/Catamaran/Catamaran/DrawningCatamaran.cs | 4 +- .../FormCatamaranCollection.Designer.cs | 74 +++++++++++++--- .../Catamaran/FormCatamaranCollection.resx | 8 +- .../Catamaran/FormCatamaranConfig.Designer.cs | 2 +- 6 files changed, 112 insertions(+), 62 deletions(-) diff --git a/base/Catamaran/Catamaran/CatamaransGenericCollection.cs b/base/Catamaran/Catamaran/CatamaransGenericCollection.cs index cd3a487..0146196 100644 --- a/base/Catamaran/Catamaran/CatamaransGenericCollection.cs +++ b/base/Catamaran/Catamaran/CatamaransGenericCollection.cs @@ -150,6 +150,8 @@ namespace Catamaran.Generics } if (catamaran != null) { + catamaran._pictureWidth = _pictureWidth; + catamaran._pictureHeight = _pictureHeight; catamaran.SetPosition(i % width * _placeSizeWidth + _placeSizeWidth / 40, (height - diff) * _placeSizeHeight + _placeSizeHeight / 15); catamaran.DrawTransport(g); diff --git a/base/Catamaran/Catamaran/CatamaransGenericStorage.cs b/base/Catamaran/Catamaran/CatamaransGenericStorage.cs index ddf2151..25c1a88 100644 --- a/base/Catamaran/Catamaran/CatamaransGenericStorage.cs +++ b/base/Catamaran/Catamaran/CatamaransGenericStorage.cs @@ -99,7 +99,7 @@ namespace Catamaran.Generics File.Delete(filename); } StringBuilder data = new(); - foreach (KeyValuePair> record in _catamaranStorages) + foreach (KeyValuePair> record in _catamaranStorages) { StringBuilder records = new(); foreach (DrawningCatamaran? elem in record.Value.GetCatamarans) @@ -112,70 +112,64 @@ namespace Catamaran.Generics { return false; } - using FileStream fs = new(filename, FileMode.Create); - byte[] info = new - UTF8Encoding(true).GetBytes($"CatamaranStorage{Environment.NewLine}{data}"); - fs.Write(info, 0, info.Length); + using (StreamWriter writer = new StreamWriter(filename)) + { + writer.Write($"CatamaranStorage{Environment.NewLine}{data}"); + } return true; } - /// - /// Загрузка информации по катамаранам в хранилище из файла - /// - /// Путь и имя файла - /// true - загрузка прошла успешно, false - ошибка призагрузке данных + public bool LoadData(string filename) { if (!File.Exists(filename)) { return false; } - string bufferTextFromFile = ""; - using (FileStream fs = new(filename, FileMode.Open)) + + using (StreamReader fs = File.OpenText(filename)) { - byte[] b = new byte[fs.Length]; - UTF8Encoding temp = new(true); - while (fs.Read(b, 0, b.Length) > 0) + string str = fs.ReadLine(); + if (str == null || str.Length == 0) { - bufferTextFromFile += temp.GetString(b); + return false; } - } - var strs = bufferTextFromFile.Split(new char[] { '\n', '\r' }, - StringSplitOptions.RemoveEmptyEntries); - if (strs == null || strs.Length == 0) - { - return false; - } - if (!strs[0].StartsWith("CatamaranStorage")) - { - //если нет такой записи, то это не те данные - return false; - } - _catamaranStorages.Clear(); - foreach (string data in strs) - { - string[] record = data.Split(_separatorForKeyValue, StringSplitOptions.RemoveEmptyEntries); - if (record.Length != 2) + if (!str.StartsWith("CatamaranStorage")) { - continue; + return false; } - CatamaransGenericCollection - collection = new(_pictureWidth, _pictureHeight); - string[] set = record[1].Split(_separatorRecords, - StringSplitOptions.RemoveEmptyEntries); - foreach (string elem in set) + + _catamaranStorages.Clear(); + string strs = ""; + + while ((strs = fs.ReadLine()) != null) { - DrawningCatamaran? catamaran = elem?.CreateDrawningCatamaran(_separatorForObject, _pictureWidth, _pictureHeight); - if (catamaran != null) + if (strs == null) { - if (!(collection + catamaran)) + return false; + } + + string[] record = strs.Split(_separatorForKeyValue, StringSplitOptions.RemoveEmptyEntries); + if (record.Length != 2) + { + continue; + } + CatamaransGenericCollection collection = new(_pictureWidth, _pictureHeight); + string[] set = record[1].Split(_separatorRecords, StringSplitOptions.RemoveEmptyEntries); + foreach (string elem in set) + { + DrawningCatamaran? catamaran = elem?.CreateDrawningCatamaran(_separatorForObject, _pictureWidth, _pictureHeight); + if (catamaran != null) { - return false; + if (!(collection + catamaran)) + { + return false; + } } } + _catamaranStorages.Add(record[0], collection); } - _catamaranStorages.Add(record[0], collection); + return true; } - return true; } } } \ No newline at end of file diff --git a/base/Catamaran/Catamaran/DrawningCatamaran.cs b/base/Catamaran/Catamaran/DrawningCatamaran.cs index b765652..535425d 100644 --- a/base/Catamaran/Catamaran/DrawningCatamaran.cs +++ b/base/Catamaran/Catamaran/DrawningCatamaran.cs @@ -20,11 +20,11 @@ namespace Catamaran.DrawningObjects /// /// Ширина окна /// - private int _pictureWidth; + public int _pictureWidth; /// /// Высота окна /// - private int _pictureHeight; + public int _pictureHeight; /// /// Левая координата прорисовки катамарана /// diff --git a/base/Catamaran/Catamaran/FormCatamaranCollection.Designer.cs b/base/Catamaran/Catamaran/FormCatamaranCollection.Designer.cs index 238e6f2..a057197 100644 --- a/base/Catamaran/Catamaran/FormCatamaranCollection.Designer.cs +++ b/base/Catamaran/Catamaran/FormCatamaranCollection.Designer.cs @@ -39,9 +39,16 @@ this.ButtonRefreshCollection = new System.Windows.Forms.Button(); this.ButtonRemoveCatamaran = new System.Windows.Forms.Button(); this.ButtonAddCatamaran = new System.Windows.Forms.Button(); + this.menuStrip = new System.Windows.Forms.MenuStrip(); + this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SaveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.LoadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCollection)).BeginInit(); this.groupBoxTools.SuspendLayout(); this.groupBoxSets.SuspendLayout(); + this.menuStrip.SuspendLayout(); this.SuspendLayout(); // // pictureBoxCollection @@ -59,6 +66,7 @@ this.groupBoxTools.Controls.Add(this.ButtonRefreshCollection); this.groupBoxTools.Controls.Add(this.ButtonRemoveCatamaran); this.groupBoxTools.Controls.Add(this.ButtonAddCatamaran); + this.groupBoxTools.Controls.Add(this.menuStrip); this.groupBoxTools.Location = new System.Drawing.Point(739, 1); this.groupBoxTools.Name = "groupBoxTools"; this.groupBoxTools.Size = new System.Drawing.Size(147, 460); @@ -72,23 +80,23 @@ this.groupBoxSets.Controls.Add(this.buttonDelObject); this.groupBoxSets.Controls.Add(this.listBoxStorages); this.groupBoxSets.Controls.Add(this.buttonAddObject); - this.groupBoxSets.Location = new System.Drawing.Point(3, 21); + this.groupBoxSets.Location = new System.Drawing.Point(3, 63); this.groupBoxSets.Name = "groupBoxSets"; - this.groupBoxSets.Size = new System.Drawing.Size(138, 245); + this.groupBoxSets.Size = new System.Drawing.Size(138, 203); this.groupBoxSets.TabIndex = 4; this.groupBoxSets.TabStop = false; this.groupBoxSets.Text = "Наборы"; // // textBoxStorageName // - this.textBoxStorageName.Location = new System.Drawing.Point(3, 36); + this.textBoxStorageName.Location = new System.Drawing.Point(6, 22); this.textBoxStorageName.Name = "textBoxStorageName"; - this.textBoxStorageName.Size = new System.Drawing.Size(134, 23); + this.textBoxStorageName.Size = new System.Drawing.Size(130, 23); this.textBoxStorageName.TabIndex = 4; // // buttonDelObject // - this.buttonDelObject.Location = new System.Drawing.Point(3, 209); + this.buttonDelObject.Location = new System.Drawing.Point(3, 167); this.buttonDelObject.Name = "buttonDelObject"; this.buttonDelObject.Size = new System.Drawing.Size(134, 27); this.buttonDelObject.TabIndex = 3; @@ -100,17 +108,17 @@ // this.listBoxStorages.FormattingEnabled = true; this.listBoxStorages.ItemHeight = 15; - this.listBoxStorages.Location = new System.Drawing.Point(3, 102); + this.listBoxStorages.Location = new System.Drawing.Point(6, 82); this.listBoxStorages.Name = "listBoxStorages"; - this.listBoxStorages.Size = new System.Drawing.Size(134, 94); + this.listBoxStorages.Size = new System.Drawing.Size(132, 79); this.listBoxStorages.TabIndex = 2; this.listBoxStorages.SelectedIndexChanged += new System.EventHandler(this.ListBoxObjects_SelectedIndexChanged); // // buttonAddObject // - this.buttonAddObject.Location = new System.Drawing.Point(3, 65); + this.buttonAddObject.Location = new System.Drawing.Point(6, 51); this.buttonAddObject.Name = "buttonAddObject"; - this.buttonAddObject.Size = new System.Drawing.Size(134, 25); + this.buttonAddObject.Size = new System.Drawing.Size(131, 25); this.buttonAddObject.TabIndex = 1; this.buttonAddObject.Text = "Добавить набор"; this.buttonAddObject.UseVisualStyleBackColor = true; @@ -153,13 +161,51 @@ this.ButtonAddCatamaran.UseVisualStyleBackColor = true; this.ButtonAddCatamaran.Click += new System.EventHandler(this.ButtonAddCatamaran_Click); // + // menuStrip + // + this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.ToolStripMenuItem}); + this.menuStrip.Location = new System.Drawing.Point(3, 19); + this.menuStrip.Name = "menuStrip"; + this.menuStrip.Size = new System.Drawing.Size(141, 24); + this.menuStrip.TabIndex = 5; + this.menuStrip.Text = "menuStrip"; + // + // ToolStripMenuItem + // + this.ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.SaveToolStripMenuItem, + this.LoadToolStripMenuItem}); + this.ToolStripMenuItem.Name = "ToolStripMenuItem"; + this.ToolStripMenuItem.Size = new System.Drawing.Size(48, 20); + this.ToolStripMenuItem.Text = "Файл"; + // + // SaveToolStripMenuItem + // + this.SaveToolStripMenuItem.Name = "SaveToolStripMenuItem"; + this.SaveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.SaveToolStripMenuItem.Text = "Сохранение"; + this.SaveToolStripMenuItem.Click += new System.EventHandler(this.SaveToolStripMenuItem_Click); + // + // LoadToolStripMenuItem + // + this.LoadToolStripMenuItem.Name = "LoadToolStripMenuItem"; + this.LoadToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.LoadToolStripMenuItem.Text = "Загрузка"; + this.LoadToolStripMenuItem.Click += new System.EventHandler(this.LoadToolStripMenuItem_Click); + // + // openFileDialog + // + this.openFileDialog.FileName = "openFileDialog1"; + // // FormCatamaranCollection // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(884, 461); + this.ClientSize = new System.Drawing.Size(885, 461); this.Controls.Add(this.groupBoxTools); this.Controls.Add(this.pictureBoxCollection); + this.MainMenuStrip = this.menuStrip; this.Name = "FormCatamaranCollection"; this.Text = "Набор катамаранов"; ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCollection)).EndInit(); @@ -167,6 +213,8 @@ this.groupBoxTools.PerformLayout(); this.groupBoxSets.ResumeLayout(false); this.groupBoxSets.PerformLayout(); + this.menuStrip.ResumeLayout(false); + this.menuStrip.PerformLayout(); this.ResumeLayout(false); } @@ -184,5 +232,11 @@ private Button buttonDelObject; private ListBox listBoxStorages; private TextBox textBoxStorageName; + private MenuStrip menuStrip; + private ToolStripMenuItem ToolStripMenuItem; + private ToolStripMenuItem SaveToolStripMenuItem; + private ToolStripMenuItem LoadToolStripMenuItem; + private SaveFileDialog saveFileDialog; + private OpenFileDialog openFileDialog; } } \ No newline at end of file diff --git a/base/Catamaran/Catamaran/FormCatamaranCollection.resx b/base/Catamaran/Catamaran/FormCatamaranCollection.resx index c8f11b0..e9d6757 100644 --- a/base/Catamaran/Catamaran/FormCatamaranCollection.resx +++ b/base/Catamaran/Catamaran/FormCatamaranCollection.resx @@ -60,13 +60,13 @@ 17, 17 - + 125, 17 - - 258, 17 + + 254, 17 - 154 + 96 \ No newline at end of file diff --git a/base/Catamaran/Catamaran/FormCatamaranConfig.Designer.cs b/base/Catamaran/Catamaran/FormCatamaranConfig.Designer.cs index ce830d0..cbd3ca4 100644 --- a/base/Catamaran/Catamaran/FormCatamaranConfig.Designer.cs +++ b/base/Catamaran/Catamaran/FormCatamaranConfig.Designer.cs @@ -145,7 +145,7 @@ // // panelYellow // - this.panelYellow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); + this.panelYellow.BackColor = System.Drawing.Color.Gold; this.panelYellow.Location = new System.Drawing.Point(187, 29); this.panelYellow.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.panelYellow.Name = "panelYellow"; -- 2.25.1 From 9379418cf79cd85e77bfd3b3bd34c3993817d6f6 Mon Sep 17 00:00:00 2001 From: "safiulova.k" Date: Tue, 5 Dec 2023 00:33:53 +0400 Subject: [PATCH 3/4] =?UTF-8?q?=D1=82=D1=83=D1=82=20=D1=87=D1=82=D0=BE=20?= =?UTF-8?q?=D1=82=D0=BE=20=D0=B4=D0=BE=D0=B4=D0=B5=D0=BB=D0=B0=D0=BD=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/Catamaran/Catamaran/EntityCatamaran.cs | 3 ++- base/Catamaran/Catamaran/EntitySailCatamaran.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/base/Catamaran/Catamaran/EntityCatamaran.cs b/base/Catamaran/Catamaran/EntityCatamaran.cs index 1dbfabb..614c963 100644 --- a/base/Catamaran/Catamaran/EntityCatamaran.cs +++ b/base/Catamaran/Catamaran/EntityCatamaran.cs @@ -33,7 +33,8 @@ namespace Catamaran.Entities /// Скорость /// Вес автомобиля /// Основной цвет - public EntityCatamaran(int speed, double weight, Color bodyColor) + + public EntityCatamaran(int speed, double weight, Color bodyColor) { Speed = speed; Weight = weight; diff --git a/base/Catamaran/Catamaran/EntitySailCatamaran.cs b/base/Catamaran/Catamaran/EntitySailCatamaran.cs index d790525..90e2f10 100644 --- a/base/Catamaran/Catamaran/EntitySailCatamaran.cs +++ b/base/Catamaran/Catamaran/EntitySailCatamaran.cs @@ -39,5 +39,6 @@ namespace Catamaran.Entities Sail = sail; FloatDetail = floatDetail; } + } } -- 2.25.1 From 7e81c6ca04d4e90540f795b7a31fc149f1d789e2 Mon Sep 17 00:00:00 2001 From: "safiulova.k" Date: Tue, 5 Dec 2023 01:54:50 +0400 Subject: [PATCH 4/4] =?UTF-8?q?=D1=82=D1=80=D0=B5=D1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/Catamaran/Catamaran/EntityCatamaran.cs | 4 ++++ base/Catamaran/Catamaran/EntitySailCatamaran.cs | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/base/Catamaran/Catamaran/EntityCatamaran.cs b/base/Catamaran/Catamaran/EntityCatamaran.cs index 614c963..f486b99 100644 --- a/base/Catamaran/Catamaran/EntityCatamaran.cs +++ b/base/Catamaran/Catamaran/EntityCatamaran.cs @@ -40,6 +40,10 @@ namespace Catamaran.Entities Weight = weight; BodyColor = bodyColor; } + public void setBodyColor(Color color) + { + BodyColor = color; + } } } diff --git a/base/Catamaran/Catamaran/EntitySailCatamaran.cs b/base/Catamaran/Catamaran/EntitySailCatamaran.cs index 90e2f10..82f9361 100644 --- a/base/Catamaran/Catamaran/EntitySailCatamaran.cs +++ b/base/Catamaran/Catamaran/EntitySailCatamaran.cs @@ -39,6 +39,9 @@ namespace Catamaran.Entities Sail = sail; FloatDetail = floatDetail; } - + public void setAdditionalColor(Color color) + { + AdditionalColor = color; + } } } -- 2.25.1