From fdba620e54e4c72e7f2ac312a44edf62b36ff2dd Mon Sep 17 00:00:00 2001 From: "DozorovaA.A" Date: Sat, 19 Nov 2022 18:32:34 +0400 Subject: [PATCH 1/3] comparison of object --- ArmoredVehicle/DrawningObject.cs | 40 ++++++++++++++++++++++ ArmoredVehicle/IDrawningObject.cs | 2 +- ArmoredVehicle/MapWithSetMachineGeneric.cs | 2 +- ArmoredVehicle/SetMachineGeneric.cs | 10 +++--- 4 files changed, 48 insertions(+), 6 deletions(-) diff --git a/ArmoredVehicle/DrawningObject.cs b/ArmoredVehicle/DrawningObject.cs index ed7906e..0881d5e 100644 --- a/ArmoredVehicle/DrawningObject.cs +++ b/ArmoredVehicle/DrawningObject.cs @@ -33,5 +33,45 @@ public string GetInfo() => _machine?.GetDataForSave(); public static IDrawningObject Create(string data) => new DrawningObject(data.CreateDrawningCar()); + + public bool Equals(IDrawningObject? other) + { + if (other == null) + { + return false; + } + var otheMachine = other as DrawningObject; + if (otheMachine == null) + { + return false; + } + var machine = _machine.ArmoredVehicle; + var otherMachineMachine = otheMachine._machine.ArmoredVehicle; + if (machine.Speed != otherMachineMachine.Speed) + { + return false; + } + if (machine.Weight != otherMachineMachine.Weight) + { + return false; + } + if (machine.BodyColor != otherMachineMachine.BodyColor) + { + return false; + } + + if (machine is TankEnity && otherMachineMachine is TankEnity) + { + var tank = machine as TankEnity; + var otherMachineTank = otherMachineMachine as TankEnity; + if (tank.DopColor != otherMachineTank.DopColor || tank.Tower != otherMachineTank.Tower || + tank.MachineGun != otherMachineTank.MachineGun) + { + return false; + } + } + + return true; + } } } \ No newline at end of file diff --git a/ArmoredVehicle/IDrawningObject.cs b/ArmoredVehicle/IDrawningObject.cs index 38cdcd2..a13818e 100644 --- a/ArmoredVehicle/IDrawningObject.cs +++ b/ArmoredVehicle/IDrawningObject.cs @@ -3,7 +3,7 @@ /// /// Интерфейс для работы с объектом, прорисовываемым на форме /// - internal interface IDrawningObject + internal interface IDrawningObject : IEquatable { /// /// Шаг перемещения объекта diff --git a/ArmoredVehicle/MapWithSetMachineGeneric.cs b/ArmoredVehicle/MapWithSetMachineGeneric.cs index de88146..0f369f0 100644 --- a/ArmoredVehicle/MapWithSetMachineGeneric.cs +++ b/ArmoredVehicle/MapWithSetMachineGeneric.cs @@ -6,7 +6,7 @@ /// /// internal class MapWithSetMachineGeneric - where T : class, IDrawningObject + where T : class, IDrawningObject, IEquatable where U : AbstractMap { /// diff --git a/ArmoredVehicle/SetMachineGeneric.cs b/ArmoredVehicle/SetMachineGeneric.cs index f455bde..037a7d7 100644 --- a/ArmoredVehicle/SetMachineGeneric.cs +++ b/ArmoredVehicle/SetMachineGeneric.cs @@ -5,7 +5,7 @@ /// /// internal class SetMachineGeneric - where T : class + where T : class, IEquatable { /// /// Список объектов, которые храним @@ -16,7 +16,6 @@ /// Количество объектов в списке /// public int Count => _places.Count; - private int BusyPlaces = 0; /// /// Конструктор /// @@ -45,9 +44,12 @@ /// public int Insert(T machine, int position) { - if(position >= _maxCount) throw new StorageOverflowException(_maxCount); + if(_places.All(p => p.Equals(machine) == false)) + { + if (position >= _maxCount) throw new StorageOverflowException(_maxCount); - _places.Insert(position, machine); + _places.Insert(position, machine); + } return position; } -- 2.25.1 From 6f2ab026a98828e21cb6579c403ccf487c621e90 Mon Sep 17 00:00:00 2001 From: "DozorovaA.A" Date: Sun, 20 Nov 2022 13:50:21 +0400 Subject: [PATCH 2/3] add sort --- ArmoredVehicle/AbstractMap.cs | 8 ++- ArmoredVehicle/DrawningObject.cs | 3 +- .../FormMapWithSetMachine.Designer.cs | 50 +++++++++++++----- ArmoredVehicle/FormMapWithSetMachine.cs | 25 ++++++++- ArmoredVehicle/MachineCompareByColor.cs | 51 +++++++++++++++++++ ArmoredVehicle/MachineCompareByType.cs | 49 ++++++++++++++++++ ArmoredVehicle/MapWithSetMachineGeneric.cs | 5 +- ArmoredVehicle/SetMachineGeneric.cs | 17 +++++-- 8 files changed, 189 insertions(+), 19 deletions(-) create mode 100644 ArmoredVehicle/MachineCompareByColor.cs create mode 100644 ArmoredVehicle/MachineCompareByType.cs diff --git a/ArmoredVehicle/AbstractMap.cs b/ArmoredVehicle/AbstractMap.cs index 114defc..74df339 100644 --- a/ArmoredVehicle/AbstractMap.cs +++ b/ArmoredVehicle/AbstractMap.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace ArmoredVehicle { - internal abstract class AbstractMap + internal abstract class AbstractMap:IEquatable { private IDrawningObject _drawningObject = null; protected int[,] _map = null; @@ -225,5 +225,11 @@ namespace ArmoredVehicle protected abstract void GenerateMap(); protected abstract void DrawRoadPart(Graphics g, int i, int j); protected abstract void DrawBarrierPart(Graphics g, int i, int j); + + public bool Equals(AbstractMap? other) + { + return this == other && this._width == other._width && + this._height == other._height && this._map == other._map && this._drawningObject == other._drawningObject; + } } } \ No newline at end of file diff --git a/ArmoredVehicle/DrawningObject.cs b/ArmoredVehicle/DrawningObject.cs index 0881d5e..694b52a 100644 --- a/ArmoredVehicle/DrawningObject.cs +++ b/ArmoredVehicle/DrawningObject.cs @@ -8,6 +8,7 @@ { _machine = machine; } + public DrawingArmoredVehicle GetMachine => _machine; public float Step => _machine?.ArmoredVehicle?.Step ?? 0; @@ -69,7 +70,7 @@ { return false; } - } + }else return false; return true; } diff --git a/ArmoredVehicle/FormMapWithSetMachine.Designer.cs b/ArmoredVehicle/FormMapWithSetMachine.Designer.cs index cfcbae4..f712423 100644 --- a/ArmoredVehicle/FormMapWithSetMachine.Designer.cs +++ b/ArmoredVehicle/FormMapWithSetMachine.Designer.cs @@ -52,6 +52,8 @@ this.LoadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); + this.SortBuTypeButton = new System.Windows.Forms.Button(); + this.SortByColorButton = new System.Windows.Forms.Button(); this.groupBoxInstruments.SuspendLayout(); this.groupBoxMap.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxImage)).BeginInit(); @@ -60,6 +62,8 @@ // // groupBoxInstruments // + this.groupBoxInstruments.Controls.Add(this.SortByColorButton); + this.groupBoxInstruments.Controls.Add(this.SortBuTypeButton); this.groupBoxInstruments.Controls.Add(this.groupBoxMap); this.groupBoxInstruments.Controls.Add(this.maskedTextBoxPosition); this.groupBoxInstruments.Controls.Add(this.ButtonDown); @@ -73,7 +77,7 @@ this.groupBoxInstruments.Dock = System.Windows.Forms.DockStyle.Right; this.groupBoxInstruments.Location = new System.Drawing.Point(964, 33); this.groupBoxInstruments.Name = "groupBoxInstruments"; - this.groupBoxInstruments.Size = new System.Drawing.Size(300, 877); + this.groupBoxInstruments.Size = new System.Drawing.Size(300, 1003); this.groupBoxInstruments.TabIndex = 0; this.groupBoxInstruments.TabStop = false; this.groupBoxInstruments.Text = "Инструменты"; @@ -147,7 +151,7 @@ // // maskedTextBoxPosition // - this.maskedTextBoxPosition.Location = new System.Drawing.Point(10, 506); + this.maskedTextBoxPosition.Location = new System.Drawing.Point(10, 613); this.maskedTextBoxPosition.Mask = "00"; this.maskedTextBoxPosition.Name = "maskedTextBoxPosition"; this.maskedTextBoxPosition.Size = new System.Drawing.Size(270, 31); @@ -158,7 +162,7 @@ this.ButtonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.ButtonDown.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("ButtonDown.BackgroundImage"))); this.ButtonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.ButtonDown.Location = new System.Drawing.Point(129, 821); + this.ButtonDown.Location = new System.Drawing.Point(129, 947); this.ButtonDown.Name = "ButtonDown"; this.ButtonDown.Size = new System.Drawing.Size(40, 36); this.ButtonDown.TabIndex = 17; @@ -170,7 +174,7 @@ this.ButtonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.ButtonRight.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("ButtonRight.BackgroundImage"))); this.ButtonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.ButtonRight.Location = new System.Drawing.Point(172, 774); + this.ButtonRight.Location = new System.Drawing.Point(172, 900); this.ButtonRight.Name = "ButtonRight"; this.ButtonRight.Size = new System.Drawing.Size(40, 36); this.ButtonRight.TabIndex = 16; @@ -182,7 +186,7 @@ this.ButtonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.ButtonLeft.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("ButtonLeft.BackgroundImage"))); this.ButtonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.ButtonLeft.Location = new System.Drawing.Point(89, 776); + this.ButtonLeft.Location = new System.Drawing.Point(89, 902); this.ButtonLeft.Name = "ButtonLeft"; this.ButtonLeft.Size = new System.Drawing.Size(40, 36); this.ButtonLeft.TabIndex = 15; @@ -194,7 +198,7 @@ this.ButtonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.ButtonUp.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("ButtonUp.BackgroundImage"))); this.ButtonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.ButtonUp.Location = new System.Drawing.Point(129, 726); + this.ButtonUp.Location = new System.Drawing.Point(129, 852); this.ButtonUp.Name = "ButtonUp"; this.ButtonUp.Size = new System.Drawing.Size(40, 36); this.ButtonUp.TabIndex = 14; @@ -203,7 +207,7 @@ // // buttonMap // - this.buttonMap.Location = new System.Drawing.Point(18, 680); + this.buttonMap.Location = new System.Drawing.Point(18, 787); this.buttonMap.Name = "buttonMap"; this.buttonMap.Size = new System.Drawing.Size(262, 34); this.buttonMap.TabIndex = 5; @@ -213,7 +217,7 @@ // // buttonStore // - this.buttonStore.Location = new System.Drawing.Point(16, 614); + this.buttonStore.Location = new System.Drawing.Point(16, 721); this.buttonStore.Name = "buttonStore"; this.buttonStore.Size = new System.Drawing.Size(264, 34); this.buttonStore.TabIndex = 4; @@ -223,7 +227,7 @@ // // buttonDelete // - this.buttonDelete.Location = new System.Drawing.Point(12, 561); + this.buttonDelete.Location = new System.Drawing.Point(12, 668); this.buttonDelete.Name = "buttonDelete"; this.buttonDelete.Size = new System.Drawing.Size(268, 34); this.buttonDelete.TabIndex = 3; @@ -233,7 +237,7 @@ // // buttonAdd // - this.buttonAdd.Location = new System.Drawing.Point(5, 444); + this.buttonAdd.Location = new System.Drawing.Point(5, 551); this.buttonAdd.Name = "buttonAdd"; this.buttonAdd.Size = new System.Drawing.Size(275, 34); this.buttonAdd.TabIndex = 1; @@ -246,7 +250,7 @@ this.pictureBoxImage.Dock = System.Windows.Forms.DockStyle.Fill; this.pictureBoxImage.Location = new System.Drawing.Point(0, 33); this.pictureBoxImage.Name = "pictureBoxImage"; - this.pictureBoxImage.Size = new System.Drawing.Size(964, 877); + this.pictureBoxImage.Size = new System.Drawing.Size(964, 1003); this.pictureBoxImage.TabIndex = 1; this.pictureBoxImage.TabStop = false; // @@ -292,11 +296,31 @@ // this.saveFileDialog.Filter = "text file | *.txt"; // + // SortBuTypeButton + // + this.SortBuTypeButton.Location = new System.Drawing.Point(20, 454); + this.SortBuTypeButton.Name = "SortBuTypeButton"; + this.SortBuTypeButton.Size = new System.Drawing.Size(246, 34); + this.SortBuTypeButton.TabIndex = 20; + this.SortBuTypeButton.Text = "Сортировать по типу"; + this.SortBuTypeButton.UseVisualStyleBackColor = true; + this.SortBuTypeButton.Click += new System.EventHandler(this.SortBuTypeButton_Click); + // + // SortByColorButton + // + this.SortByColorButton.Location = new System.Drawing.Point(25, 503); + this.SortByColorButton.Name = "SortByColorButton"; + this.SortByColorButton.Size = new System.Drawing.Size(243, 34); + this.SortByColorButton.TabIndex = 21; + this.SortByColorButton.Text = "Сортировать по цвету"; + this.SortByColorButton.UseVisualStyleBackColor = true; + this.SortByColorButton.Click += new System.EventHandler(this.SortByColorButton_Click); + // // FormMapWithSetMachine // this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 25F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1264, 910); + this.ClientSize = new System.Drawing.Size(1264, 1036); this.Controls.Add(this.pictureBoxImage); this.Controls.Add(this.groupBoxInstruments); this.Controls.Add(this.menuStrip); @@ -340,5 +364,7 @@ private ToolStripMenuItem LoadToolStripMenuItem; private OpenFileDialog openFileDialog; private SaveFileDialog saveFileDialog; + private Button SortByColorButton; + private Button SortBuTypeButton; } } \ No newline at end of file diff --git a/ArmoredVehicle/FormMapWithSetMachine.cs b/ArmoredVehicle/FormMapWithSetMachine.cs index 33ce3d0..6a714f5 100644 --- a/ArmoredVehicle/FormMapWithSetMachine.cs +++ b/ArmoredVehicle/FormMapWithSetMachine.cs @@ -157,8 +157,8 @@ namespace ArmoredVehicle } if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + new DrawningObject(machine) != -1) { - MessageBox.Show("Объект добавлен"); pictureBoxImage.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet(); + MessageBox.Show("Объект добавлен"); _logger.LogInformation($"Добавлен объект {machine} на карту "); } else @@ -322,5 +322,28 @@ namespace ArmoredVehicle } } + /// Сортировка по типу + /// + /// + /// + private void SortBuTypeButton_Click(object sender, EventArgs e) + { + if (listBoxMaps.SelectedIndex == -1) + { + return; + } + _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].Sort(new MachineCompareByType()); + pictureBoxImage.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet(); + } + + private void SortByColorButton_Click(object sender, EventArgs e) + { + if (listBoxMaps.SelectedIndex == -1) + { + return; + } + _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].Sort(new MachineCompareByColor()); + pictureBoxImage.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet(); + } } } diff --git a/ArmoredVehicle/MachineCompareByColor.cs b/ArmoredVehicle/MachineCompareByColor.cs new file mode 100644 index 0000000..53947fb --- /dev/null +++ b/ArmoredVehicle/MachineCompareByColor.cs @@ -0,0 +1,51 @@ +namespace ArmoredVehicle +{ + internal class MachineCompareByColor : IComparer + { + public int Compare(IDrawningObject? x, IDrawningObject? y) + { + if (x == null && y == null) + { + return 0; + } + if (x == null && y != null) + { + return 1; + } + if (x != null && y == null) + { + return -1; + } + var xCar = x as DrawningObject; + var yCar = y as DrawningObject; + if (xCar == null && yCar == null) + { + return 0; + } + if (xCar == null && yCar != null) + { + return 1; + } + if (xCar != null && yCar == null) + { + return -1; + } + if (xCar.GetMachine.ArmoredVehicle.BodyColor == yCar.GetMachine.ArmoredVehicle.BodyColor) + { + return 0; + } + if (xCar.GetMachine.ArmoredVehicle.BodyColor.R > yCar.GetMachine.ArmoredVehicle.BodyColor.R) + { + if (xCar.GetMachine.ArmoredVehicle.BodyColor.G > yCar.GetMachine.ArmoredVehicle.BodyColor.G) + { + if (xCar.GetMachine.ArmoredVehicle.BodyColor.B > yCar.GetMachine.ArmoredVehicle.BodyColor.B) + { + return 1; + } + else return -1; + } + else return -1; + } else return -1; + } + } +} \ No newline at end of file diff --git a/ArmoredVehicle/MachineCompareByType.cs b/ArmoredVehicle/MachineCompareByType.cs new file mode 100644 index 0000000..2cbded5 --- /dev/null +++ b/ArmoredVehicle/MachineCompareByType.cs @@ -0,0 +1,49 @@ +namespace ArmoredVehicle +{ + internal class MachineCompareByType : IComparer + { + public int Compare(IDrawningObject? x, IDrawningObject? y) + { + if (x == null && y == null) + { + return 0; + } + if (x == null && y != null) + { + return 1; + } + if (x != null && y == null) + { + return -1; + } + var xMachine= x as DrawningObject; + var yMachine = y as DrawningObject; + if (xMachine == null && yMachine == null) + { + return 0; + } + if (xMachine == null && yMachine != null) + { + return 1; + } + if (xMachine != null && yMachine == null) + { + return -1; + } + if (xMachine.GetMachine.GetType().Name != yMachine.GetMachine.GetType().Name) + { + if (xMachine.GetMachine.GetType().Name == "DrawningCar") + { + return -1; + } + return 1; + } + var speedCompare = xMachine.GetMachine.ArmoredVehicle.Speed.CompareTo(yMachine.GetMachine.ArmoredVehicle.Speed); + if (speedCompare != 0) + { + return speedCompare; + } + return xMachine.GetMachine.ArmoredVehicle.Weight.CompareTo(yMachine.GetMachine.ArmoredVehicle.Weight); + } + } +} \ No newline at end of file diff --git a/ArmoredVehicle/MapWithSetMachineGeneric.cs b/ArmoredVehicle/MapWithSetMachineGeneric.cs index 0f369f0..c928421 100644 --- a/ArmoredVehicle/MapWithSetMachineGeneric.cs +++ b/ArmoredVehicle/MapWithSetMachineGeneric.cs @@ -133,7 +133,10 @@ _setMachines.Insert(DrawningObject.Create(rec) as T); } } - + public void Sort(IComparer comparer) + { + _setMachines.SortSet(comparer); + } /// /// "Взбалтываем" набор, чтобы все элементы оказались в начале /// diff --git a/ArmoredVehicle/SetMachineGeneric.cs b/ArmoredVehicle/SetMachineGeneric.cs index 037a7d7..33dc141 100644 --- a/ArmoredVehicle/SetMachineGeneric.cs +++ b/ArmoredVehicle/SetMachineGeneric.cs @@ -49,9 +49,9 @@ if (position >= _maxCount) throw new StorageOverflowException(_maxCount); _places.Insert(position, machine); + return position; } - - return position; + return -1; } /// /// Удаление объекта из набора с конкретной позиции @@ -117,6 +117,17 @@ } } } - + /// + /// Сортировка набора объектов + /// + /// + public void SortSet(IComparer comparer) + { + if (comparer == null) + { + return; + } + _places.Sort(comparer); + } } } \ No newline at end of file -- 2.25.1 From ed2545c5d6abbeac274f0b93ebcb2c5266e6d55f Mon Sep 17 00:00:00 2001 From: "DozorovaA.A" Date: Thu, 1 Dec 2022 23:44:18 +0400 Subject: [PATCH 3/3] fix --- ArmoredVehicle/DrawningObject.cs | 7 +++++-- ArmoredVehicle/MachineCompareByColor.cs | 16 +++++++--------- ArmoredVehicle/MachineCompareByType.cs | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ArmoredVehicle/DrawningObject.cs b/ArmoredVehicle/DrawningObject.cs index 694b52a..ee45c33 100644 --- a/ArmoredVehicle/DrawningObject.cs +++ b/ArmoredVehicle/DrawningObject.cs @@ -70,8 +70,11 @@ { return false; } - }else return false; - + }else if (machine is TankEnity || otherMachineMachine is TankEnity) + { + return false; + } + return true; } } diff --git a/ArmoredVehicle/MachineCompareByColor.cs b/ArmoredVehicle/MachineCompareByColor.cs index 53947fb..f7023ce 100644 --- a/ArmoredVehicle/MachineCompareByColor.cs +++ b/ArmoredVehicle/MachineCompareByColor.cs @@ -34,18 +34,16 @@ { return 0; } - if (xCar.GetMachine.ArmoredVehicle.BodyColor.R > yCar.GetMachine.ArmoredVehicle.BodyColor.R) + if (xCar.GetMachine.ArmoredVehicle.BodyColor.R.CompareTo(yCar.GetMachine.ArmoredVehicle.BodyColor.R) == 0) { - if (xCar.GetMachine.ArmoredVehicle.BodyColor.G > yCar.GetMachine.ArmoredVehicle.BodyColor.G) + if (xCar.GetMachine.ArmoredVehicle.BodyColor.R.CompareTo(yCar.GetMachine.ArmoredVehicle.BodyColor.R) == 0) { - if (xCar.GetMachine.ArmoredVehicle.BodyColor.B > yCar.GetMachine.ArmoredVehicle.BodyColor.B) - { - return 1; - } - else return -1; + return xCar.GetMachine.ArmoredVehicle.BodyColor.B.CompareTo(yCar.GetMachine.ArmoredVehicle.BodyColor.B); } - else return -1; - } else return -1; + else return xCar.GetMachine.ArmoredVehicle.BodyColor.G.CompareTo(yCar.GetMachine.ArmoredVehicle.BodyColor.G); + } + else return xCar.GetMachine.ArmoredVehicle.BodyColor.R.CompareTo(yCar.GetMachine.ArmoredVehicle.BodyColor.R); + } } } \ No newline at end of file diff --git a/ArmoredVehicle/MachineCompareByType.cs b/ArmoredVehicle/MachineCompareByType.cs index 2cbded5..6f8fd4e 100644 --- a/ArmoredVehicle/MachineCompareByType.cs +++ b/ArmoredVehicle/MachineCompareByType.cs @@ -32,7 +32,7 @@ } if (xMachine.GetMachine.GetType().Name != yMachine.GetMachine.GetType().Name) { - if (xMachine.GetMachine.GetType().Name == "DrawningCar") + if (xMachine.GetMachine.GetType().Name == "DrawingArmoredVehicle") { return -1; } -- 2.25.1