From 7c9431a20ecc160ad7a0eefc746f13db7d4185cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=9C=D0=B0=D0=BB?= =?UTF-8?q?=D0=B0=D1=84=D0=B5=D0=B5=D0=B2?= Date: Sun, 3 Dec 2023 15:02:10 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=B8=D0=BA6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cruiser/Drawing/DrawingCruiser.cs | 21 ++-- Cruiser/Drawing/DrawingProCruiser.cs | 7 +- Cruiser/Drawing/ExtentionDrawingCruiser.cs | 64 +++++++++++ Cruiser/Entities/EntityCruiser.cs | 10 +- Cruiser/Entities/EntityProCruiser.cs | 7 +- Cruiser/FormCruiser.cs | 6 +- Cruiser/FormCruiserCollection.Designer.cs | 64 ++++++++++- Cruiser/FormCruiserCollection.cs | 39 +++++++ Cruiser/FormCruiserCollection.resx | 9 ++ Cruiser/FormCruiserConfig.cs | 8 +- Cruiser/Generics/CruisersGenericCollection.cs | 4 + Cruiser/Generics/CruisersGenericStorage.cs | 104 +++++++++++++++++- Cruiser/resources/saveFileDialog.txt | 4 + 13 files changed, 308 insertions(+), 39 deletions(-) create mode 100644 Cruiser/Drawing/ExtentionDrawingCruiser.cs create mode 100644 Cruiser/resources/saveFileDialog.txt diff --git a/Cruiser/Drawing/DrawingCruiser.cs b/Cruiser/Drawing/DrawingCruiser.cs index 4bf62b9..8e593c4 100644 --- a/Cruiser/Drawing/DrawingCruiser.cs +++ b/Cruiser/Drawing/DrawingCruiser.cs @@ -63,7 +63,7 @@ namespace Cruiser.Drawing /// Элементов цвет /// Ширина картинки /// Высота картинки - public DrawingCruiser(int speed, double weight, Color bodyColor, Color secColor, int width, int height) + public DrawingCruiser(int speed, double weight, Color bodyColor, int width, int height) { if (width < _cruiserWidth || height < _cruiserHeight) { @@ -72,7 +72,7 @@ namespace Cruiser.Drawing } _pictureWidth = width; _pictureHeight = height; - EntityCruiser = new EntityCruiser(speed, weight, bodyColor, secColor); + EntityCruiser = new EntityCruiser(speed, weight, bodyColor);//переделал конструктор, т.к. secColor не использовался в конечном результате для отрисовки } /// /// Конструктор @@ -80,18 +80,17 @@ namespace Cruiser.Drawing /// Скорость /// Вес автомобиля /// Основной цвет - /// Элементов цвет /// Ширина картинки /// Высота картинки /// Ширина прорисовки крейсера /// Высота прорисовки крейсера - public DrawingCruiser(int speed, double weight, Color bodyColor, Color secColor, int width, int height, int cruiserWidth, int cruiserHeight) + public DrawingCruiser(int speed, double weight, Color bodyColor, int width, int height, int cruiserWidth, int cruiserHeight) { _pictureWidth = width; _pictureHeight = height; _cruiserHeight = cruiserHeight; _cruiserWidth = cruiserWidth; - EntityCruiser = new EntityCruiser(speed, weight, bodyColor, secColor); + EntityCruiser = new EntityCruiser(speed, weight, bodyColor); //переделал конструктор, т.к. secColor не использовался в конечном результате для отрисовки } /// /// Установка позиции @@ -199,6 +198,7 @@ namespace Cruiser.Drawing Brush brush = new SolidBrush(EntityCruiser.BodyColor); g.FillPolygon(brush, Paluba); // элементы + Brush colForElem = new SolidBrush(Color.Black); //поменял цвет для элементов(ОСНОВНЫХ) на чёрный, т.к. secColor не использовался Point[] Elements = new Point[8] { new Point(_startPosX + 50,_startPosY + 20), @@ -210,13 +210,12 @@ namespace Cruiser.Drawing new Point(_startPosX + 70,_startPosY + 40), new Point(_startPosX + 50,_startPosY + 40), }; - Brush brushElem = new SolidBrush(EntityCruiser.SecondColor); - g.FillPolygon(brushElem, Elements); - g.FillEllipse(brushElem, _startPosX + 100, _startPosY + 20, 20, 20); + // шар на корабле + g.FillPolygon(colForElem, Elements); + g.FillEllipse(colForElem, _startPosX + 100, _startPosY + 20, 20, 20); // турбины - Brush Turbins = new SolidBrush(Color.Black); - g.FillRectangle(Turbins, _startPosX, _startPosY + 10, 10, 20); - g.FillRectangle(Turbins, _startPosX, _startPosY + 35, 10, 20); + g.FillRectangle(colForElem, _startPosX, _startPosY + 10, 10, 20); + g.FillRectangle(colForElem, _startPosX, _startPosY + 35, 10, 20); } } } diff --git a/Cruiser/Drawing/DrawingProCruiser.cs b/Cruiser/Drawing/DrawingProCruiser.cs index 6161167..aac6545 100644 --- a/Cruiser/Drawing/DrawingProCruiser.cs +++ b/Cruiser/Drawing/DrawingProCruiser.cs @@ -16,12 +16,13 @@ namespace Cruiser.Drawing { (EntityCruiser as EntityProCruiser).ElementsColor = color; } - public DrawingProCruiser(int speed, double weight, Color bodyColor, Color secColor, Color elemColor, bool rocketMines, bool helipad, int width, int height) : - base (speed, weight, bodyColor, secColor, width, height, 150, 60) + public DrawingProCruiser(int speed, double weight, Color bodyColor, Color elemColor, bool rocketMines, bool helipad, int width, int height) : + base (speed, weight, bodyColor, width, height, 150, 60) { if (EntityCruiser != null) { - EntityCruiser = new EntityProCruiser(speed, weight, bodyColor, secColor, elemColor, rocketMines, helipad); + EntityCruiser = new EntityProCruiser(speed, weight, bodyColor, elemColor, rocketMines, helipad); + // по тем же причинам, что и для обычного, фиксим конструктор класса отрисовки для улучшенного } } public override void DrawTransport(Graphics g) diff --git a/Cruiser/Drawing/ExtentionDrawingCruiser.cs b/Cruiser/Drawing/ExtentionDrawingCruiser.cs new file mode 100644 index 0000000..1115c05 --- /dev/null +++ b/Cruiser/Drawing/ExtentionDrawingCruiser.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Cruiser.Drawing; +using Cruiser.Entities; +namespace Cruiser.Drawing +{ + /// + /// Расширение для класса EntityCruiser + /// + public static class ExtentionDrawningCruiser + { + /// + /// Создание объекта из строки + /// + /// Строка с данными для создания объекта + /// Разделитель даннных + /// Ширина + /// Высота + /// Объект + public static DrawingCruiser? CreateDrawingCruiser(this string info, char separatorForObject, int width, int height) + { + string[] strs = info.Split(separatorForObject); + if (strs.Length == 3) + { + return new DrawingCruiser(Convert.ToInt32(strs[0]), Convert.ToInt32(strs[1]), Color.FromName(strs[2]), width, height); + } + if (strs.Length == 6) + { + return new DrawingProCruiser(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 DrawingCruiser drawingCruiser, char separatorForObject) + { + var cruiser = drawingCruiser.EntityCruiser; + if (cruiser == null) + { + return string.Empty; + } + var str = $"{cruiser.Speed}{separatorForObject}{cruiser.Weight}{separatorForObject}{cruiser.BodyColor.Name}"; + if (cruiser is not EntityProCruiser proCruiser) + { + return str; + } + return $"{str}{separatorForObject}{proCruiser.ElementsColor.Name}{separatorForObject}{proCruiser.RocketMines}{separatorForObject}{proCruiser.Helipad}"; + } + } +} + + diff --git a/Cruiser/Entities/EntityCruiser.cs b/Cruiser/Entities/EntityCruiser.cs index 6aa3721..d901196 100644 --- a/Cruiser/Entities/EntityCruiser.cs +++ b/Cruiser/Entities/EntityCruiser.cs @@ -24,23 +24,19 @@ namespace Cruiser.Entities /// public Color BodyColor { get; set; } /// - /// Второстепенный цвет - /// - public Color SecondColor { get; set; } - /// /// Шаг перемещения Крейсера /// + // убрал secColor т.к. у обычного крейсера должен быть один цвет + не использовался для отрисовки public double Step => (double)Speed * 100 / Weight; /// Скорость /// Вес Крейсера /// Основной цвет /// Второстепенный цвет - public EntityCruiser(int speed, double weight, Color bodyColor, Color secColor) + public EntityCruiser(int speed, double weight, Color bodyColor) { Speed = speed; Weight = weight; - BodyColor = bodyColor; - SecondColor = secColor; + BodyColor = bodyColor; // переделал конструктор и убрал secondColor, т.к. у обычного крейсера должен быть один цвет + не использовался для отрисовки } } } diff --git a/Cruiser/Entities/EntityProCruiser.cs b/Cruiser/Entities/EntityProCruiser.cs index 6d45247..a7d23e4 100644 --- a/Cruiser/Entities/EntityProCruiser.cs +++ b/Cruiser/Entities/EntityProCruiser.cs @@ -26,16 +26,15 @@ namespace Cruiser.Entities /// Скорость /// Вес Крейсера /// Основной цвет - /// Второстепенный цвет /// Элементов цвет /// Признак наличия ракетных шахт /// Признак наличия вертолётной площадки - public EntityProCruiser(int speed, double weight, Color bodyColor, Color secColor, Color elemColor, bool rocketMines, bool helipad) : - base(speed, weight, bodyColor, secColor) + public EntityProCruiser(int speed, double weight, Color bodyColor, Color elemColor, bool rocketMines, bool helipad) : + base(speed, weight, bodyColor) { RocketMines = rocketMines; Helipad = helipad; - ElementsColor = elemColor; + ElementsColor = elemColor; // по тем же причинам, что и для обычного, фиксим конструктор класса для улучшенного } } } diff --git a/Cruiser/FormCruiser.cs b/Cruiser/FormCruiser.cs index 7cee9c9..79bbaef 100644 --- a/Cruiser/FormCruiser.cs +++ b/Cruiser/FormCruiser.cs @@ -132,8 +132,7 @@ namespace Cruiser _drawningCruiser = new DrawingCruiser(random.Next(100, 300), random.Next(1000, 3000), - colorFirst, - Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)), + colorFirst, // pictureBoxCruiser.Width, pictureBoxCruiser.Height); _drawningCruiser.SetPosition(random.Next(10, 100), random.Next(10, 100)); @@ -157,8 +156,7 @@ namespace Cruiser _drawningCruiser = new DrawingProCruiser(random.Next(100, 300), random.Next(1000, 3000), colorFirst, - colorSecond, - Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)), + colorSecond, // Convert.ToBoolean(random.Next(1, 2)), Convert.ToBoolean(random.Next(1, 2)), pictureBoxCruiser.Width, diff --git a/Cruiser/FormCruiserCollection.Designer.cs b/Cruiser/FormCruiserCollection.Designer.cs index 8b2e0e0..79ce8b8 100644 --- a/Cruiser/FormCruiserCollection.Designer.cs +++ b/Cruiser/FormCruiserCollection.Designer.cs @@ -39,9 +39,16 @@ buttonDelObject = new Button(); textBoxStorageName = new TextBox(); buttonAddObject = new Button(); + menuStripCruiser = new MenuStrip(); + FileToolStripMenuItem = new ToolStripMenuItem(); + SaveToolStripMenuItem = new ToolStripMenuItem(); + UploadToolStripMenuItem = new ToolStripMenuItem(); + openFileDialog = new OpenFileDialog(); + saveFileDialog = new SaveFileDialog(); groupBoxTools.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)pictureBoxCollection).BeginInit(); groupBoxStorage.SuspendLayout(); + menuStripCruiser.SuspendLayout(); SuspendLayout(); // // groupBoxTools @@ -75,7 +82,7 @@ // // buttonAddCruiser // - buttonAddCruiser.Location = new Point(15, 22); + buttonAddCruiser.Location = new Point(15, 26); buttonAddCruiser.Name = "buttonAddCruiser"; buttonAddCruiser.Size = new Size(122, 38); buttonAddCruiser.TabIndex = 0; @@ -95,9 +102,9 @@ // // pictureBoxCollection // - pictureBoxCollection.Location = new Point(14, 1); + pictureBoxCollection.Location = new Point(14, 27); pictureBoxCollection.Name = "pictureBoxCollection"; - pictureBoxCollection.Size = new Size(642, 448); + pictureBoxCollection.Size = new Size(642, 422); pictureBoxCollection.TabIndex = 1; pictureBoxCollection.TabStop = false; // @@ -151,15 +158,57 @@ buttonAddObject.UseVisualStyleBackColor = true; buttonAddObject.Click += ButtonAddObject_Click; // + // menuStripCruiser + // + menuStripCruiser.Items.AddRange(new ToolStripItem[] { FileToolStripMenuItem }); + menuStripCruiser.Location = new Point(0, 0); + menuStripCruiser.Name = "menuStripCruiser"; + menuStripCruiser.Size = new Size(800, 24); + menuStripCruiser.TabIndex = 4; + menuStripCruiser.Text = "menuStrip1"; + // + // FileToolStripMenuItem + // + FileToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { SaveToolStripMenuItem, UploadToolStripMenuItem }); + FileToolStripMenuItem.Name = "FileToolStripMenuItem"; + FileToolStripMenuItem.Size = new Size(48, 20); + FileToolStripMenuItem.Text = "Файл"; + // + // SaveToolStripMenuItem + // + SaveToolStripMenuItem.Name = "SaveToolStripMenuItem"; + SaveToolStripMenuItem.Size = new Size(180, 22); + SaveToolStripMenuItem.Text = "Сохранить"; + SaveToolStripMenuItem.Click += SaveToolStripMenuItem_Click; + // + // UploadToolStripMenuItem + // + UploadToolStripMenuItem.Name = "UploadToolStripMenuItem"; + UploadToolStripMenuItem.Size = new Size(180, 22); + UploadToolStripMenuItem.Text = "Загрузить"; + UploadToolStripMenuItem.Click += LoadToolStripMenuItem_Click; + // + // openFileDialog + // + openFileDialog.FileName = "openFileDialog"; + openFileDialog.Filter = "txt file | *.txt"; + // + // saveFileDialog + // + saveFileDialog.FileName = "saveFileDialog"; + saveFileDialog.Filter = "txt file | *.txt"; + // // FormCruiserCollection // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(800, 450); + Controls.Add(menuStripCruiser); Controls.Add(buttonRefreshCollection); Controls.Add(groupBoxStorage); Controls.Add(pictureBoxCollection); Controls.Add(groupBoxTools); + MainMenuStrip = menuStripCruiser; Name = "FormCruiserCollection"; Text = "Набор Крейсеров"; groupBoxTools.ResumeLayout(false); @@ -167,7 +216,10 @@ ((System.ComponentModel.ISupportInitialize)pictureBoxCollection).EndInit(); groupBoxStorage.ResumeLayout(false); groupBoxStorage.PerformLayout(); + menuStripCruiser.ResumeLayout(false); + menuStripCruiser.PerformLayout(); ResumeLayout(false); + PerformLayout(); } #endregion @@ -183,5 +235,11 @@ private TextBox textBoxStorageName; private Button buttonAddObject; private ListBox listBoxStorages; + private MenuStrip menuStripCruiser; + private ToolStripMenuItem FileToolStripMenuItem; + private ToolStripMenuItem SaveToolStripMenuItem; + private ToolStripMenuItem UploadToolStripMenuItem; + private OpenFileDialog openFileDialog; + private SaveFileDialog saveFileDialog; } } \ No newline at end of file diff --git a/Cruiser/FormCruiserCollection.cs b/Cruiser/FormCruiserCollection.cs index d10f237..eafc0b1 100644 --- a/Cruiser/FormCruiserCollection.cs +++ b/Cruiser/FormCruiserCollection.cs @@ -184,5 +184,44 @@ namespace Cruiser formCruiserConfig.Show(); formCruiserConfig.AddEvent(AddCruiser); } + /// + /// Обработка нажатия "Сохранение" + /// + /// + /// + 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); + ReloadObjects(); + } + else + { + MessageBox.Show("Не загрузилось", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } } } diff --git a/Cruiser/FormCruiserCollection.resx b/Cruiser/FormCruiserCollection.resx index af32865..c6bf9ab 100644 --- a/Cruiser/FormCruiserCollection.resx +++ b/Cruiser/FormCruiserCollection.resx @@ -117,4 +117,13 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + + + 163, 17 + + + 296, 17 + \ No newline at end of file diff --git a/Cruiser/FormCruiserConfig.cs b/Cruiser/FormCruiserConfig.cs index 2ba9277..0ef8ea3 100644 --- a/Cruiser/FormCruiserConfig.cs +++ b/Cruiser/FormCruiserConfig.cs @@ -106,15 +106,15 @@ namespace Cruiser { switch (e.Data?.GetData(DataFormats.Text).ToString()) { - case "labelCruiser": + case "labelCruiser": //переделал из за изменения конструкторов (см. комментарии там) _cruiser = new DrawingCruiser((int)numericUpDownSpeed.Value, (int)numericUpDownWeight.Value, - Color.Orchid, Color.Black, + Color.Orchid, pictureBoxToCruiser.Width, pictureBoxToCruiser.Height); break; - case "labelProCruiser": + case "labelProCruiser": //переделал из за изменения конструкторов (см. комментарии там) _cruiser = new DrawingProCruiser((int)numericUpDownSpeed.Value, (int)numericUpDownWeight.Value, - Color.Orchid, Color.Black, Color.Aquamarine, + Color.Orchid, Color.Aquamarine, checkBoxRockMines.Checked, checkBoxHelipad.Checked, pictureBoxToCruiser.Width, pictureBoxToCruiser.Height); diff --git a/Cruiser/Generics/CruisersGenericCollection.cs b/Cruiser/Generics/CruisersGenericCollection.cs index 9302b31..a527800 100644 --- a/Cruiser/Generics/CruisersGenericCollection.cs +++ b/Cruiser/Generics/CruisersGenericCollection.cs @@ -17,6 +17,10 @@ namespace Cruiser.Generics where T : DrawingCruiser where U : IMoveableObject { + /// + /// Получение объектов коллекции + /// + public IEnumerable GetCruisers => _collection.GetCruisers(); /// /// Ширина окна прорисовки /// diff --git a/Cruiser/Generics/CruisersGenericStorage.cs b/Cruiser/Generics/CruisersGenericStorage.cs index a38eaf7..5541640 100644 --- a/Cruiser/Generics/CruisersGenericStorage.cs +++ b/Cruiser/Generics/CruisersGenericStorage.cs @@ -6,15 +6,27 @@ using System.Threading.Tasks; using Cruiser.Drawing; using Cruiser.MovementStrategy; - namespace Cruiser.Generics { internal class CruisersGenericStorage { + /// + /// Разделитель для записи ключа и значения элемента словаря + /// + private static readonly char _separatorForKeyValue = '|'; + /// + /// Разделитель для записей коллекции данных в файл + /// + private readonly char _separatorRecords = ';'; + /// + /// Разделитель для записи информации по объекту в файл + /// + private static readonly char _separatorForObject = ':'; + /// /// Словарь (хранилище) /// - readonly Dictionary> _cruiserStorages; + readonly Dictionary> _cruiserStorages; /// /// Возвращение списка названий наборов /// @@ -34,7 +46,7 @@ namespace Cruiser.Generics /// public CruisersGenericStorage(int pictureWidth, int pictureHeight) { - _cruiserStorages = new Dictionary>(); + _cruiserStorages = new Dictionary>(); _pictureWidth = pictureWidth; _pictureHeight = pictureHeight; } @@ -70,6 +82,92 @@ namespace Cruiser.Generics return null; } } + /// + /// Сохранение информации по автомобилям в хранилище в файл + /// + /// Путь и имя файла + /// true - сохранение прошло успешно, false - ошибка при сохранении данных + public bool SaveData(string filename) + { + if (File.Exists(filename)) + { + File.Delete(filename); + } + StringBuilder data = new(); + foreach (KeyValuePair> record in _cruiserStorages) + { + StringBuilder records = new(); + foreach (DrawingCruiser? elem in record.Value.GetCruisers) + { + records.Append($"{elem?.GetDataForSave(_separatorForObject)}{_separatorRecords}"); + } + data.AppendLine($"{record.Key}{_separatorForKeyValue}{records}"); + } + if (data.Length == 0) + { + return false; + } + string dataStr = data.ToString(); + using (StreamWriter writer = new StreamWriter(filename)) + { + writer.WriteLine("CruiserStorage"); + writer.WriteLine(dataStr); + } + return true; + } + /// + /// Загрузка информации по крейсеру в хранилище из файла + /// + /// Путь и имя файла + /// true - загрузка прошла успешно, false - ошибка при загрузке данных + public bool LoadData(string filename) + { + if (!File.Exists(filename)) + { + return false; + } + using (StreamReader reader = new StreamReader(filename)) + { + string checker = reader.ReadLine(); + if (checker == null) + { + return false; + } + if (!checker.StartsWith("CruiserStorage")) + { + return false; + } + _cruiserStorages.Clear(); + string strs; + bool firstinit = true; + while ((strs = reader.ReadLine()) != null) + { + if (strs == null && firstinit) + return false; + if (strs == null) + break; + if (strs == string.Empty) + break; + firstinit = false; + string name = strs.Split('|')[0]; + CarsGenericCollection collection = new(_pictureWidth, _pictureHeight); + foreach (string data in strs.Split('|')[1].Split(';').Reverse()) + { + DrawingCruiser? cruiser = data?.CreateDrawingCruiser(_separatorForObject, _pictureWidth, _pictureHeight); + if (cruiser != null) + { + if (collection + cruiser == false) + { + return false; + } + } + + } + _cruiserStorages.Add(name, collection); + } + return true; + } + } } } diff --git a/Cruiser/resources/saveFileDialog.txt b/Cruiser/resources/saveFileDialog.txt new file mode 100644 index 0000000..97475df --- /dev/null +++ b/Cruiser/resources/saveFileDialog.txt @@ -0,0 +1,4 @@ +CruiserStorage +1|100:104:Sienna:Crimson:True:True;100:100:Gold:ForestGreen:True:False;100:100:Gold; +2|100:100:Aquamarine:Red:False:False;100:100:Gold:ForestGreen:True:False;100:100:Plum; +