From f5fb433b765fb46710f0b943ff1c694ec047397c Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Mon, 5 Dec 2022 19:25:49 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9?= =?UTF-8?q?=D0=BA=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=B0=D0=B2=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F.=208-?= =?UTF-8?q?=D1=8F=20=D0=BB=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Airbus/FormMapWithSetPlanes.Designer.cs | 4 ++-- Airbus/Airbus/FormMapWithSetPlanes.cs | 4 ++-- Airbus/Airbus/PlaneCompareByColor.cs | 21 ++++++++----------- Airbus/Airbus/PlaneCompareByType.cs | 6 +++--- Airbus/Airbus/SaveData.txt | 2 +- 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/Airbus/Airbus/FormMapWithSetPlanes.Designer.cs b/Airbus/Airbus/FormMapWithSetPlanes.Designer.cs index c422579..43df6fd 100644 --- a/Airbus/Airbus/FormMapWithSetPlanes.Designer.cs +++ b/Airbus/Airbus/FormMapWithSetPlanes.Designer.cs @@ -89,7 +89,7 @@ this.buttonSortByColor.TabIndex = 12; this.buttonSortByColor.Text = "Сортировка по цвету"; this.buttonSortByColor.UseVisualStyleBackColor = true; - this.buttonSortByColor.Click += new System.EventHandler(this.buttonSortByColor_Click); + this.buttonSortByColor.Click += new System.EventHandler(this.ButtonSortByColor_Click); // // buttonSortByType // @@ -99,7 +99,7 @@ this.buttonSortByType.TabIndex = 11; this.buttonSortByType.Text = "Сортировка по типу"; this.buttonSortByType.UseVisualStyleBackColor = true; - this.buttonSortByType.Click += new System.EventHandler(this.buttonSortByType_Click); + this.buttonSortByType.Click += new System.EventHandler(this.ButtonSortByType_Click); // // groupBoxMaps // diff --git a/Airbus/Airbus/FormMapWithSetPlanes.cs b/Airbus/Airbus/FormMapWithSetPlanes.cs index 865c675..6eb55ad 100644 --- a/Airbus/Airbus/FormMapWithSetPlanes.cs +++ b/Airbus/Airbus/FormMapWithSetPlanes.cs @@ -294,7 +294,7 @@ namespace Airbus } //сортировка по типу - private void buttonSortByType_Click(object sender, EventArgs e) + private void ButtonSortByType_Click(object sender, EventArgs e) { if(listBoxMaps.SelectedIndex == -1) { @@ -306,7 +306,7 @@ namespace Airbus } //сортировка по цвету - private void buttonSortByColor_Click(object sender, EventArgs e) + private void ButtonSortByColor_Click(object sender, EventArgs e) { if (listBoxMaps.SelectedIndex == -1) { diff --git a/Airbus/Airbus/PlaneCompareByColor.cs b/Airbus/Airbus/PlaneCompareByColor.cs index 92295b6..0606000 100644 --- a/Airbus/Airbus/PlaneCompareByColor.cs +++ b/Airbus/Airbus/PlaneCompareByColor.cs @@ -20,7 +20,7 @@ namespace Airbus return 1; } - if (x != null && y != null) + if (x != null && y == null) { return -1; } @@ -40,28 +40,25 @@ namespace Airbus if (xPlane != null && yPlane == null) { - return 1; + return -1; } - var xEntity = xPlane.GetPlane.Airbus; - var yEntity = yPlane.GetPlane.Airbus; - var colorCompare = xEntity.CorpusColor.ToArgb().CompareTo(yEntity.CorpusColor.ToArgb()); - - int i = xEntity.CorpusColor.ToArgb(); - int j = yEntity.CorpusColor.ToArgb(); + var xEntityPlane = xPlane.GetPlane.Airbus; + var yEntityPlane = yPlane.GetPlane.Airbus; + var colorCompare = xEntityPlane.CorpusColor.ToArgb().CompareTo(yEntityPlane.CorpusColor.ToArgb()); if (colorCompare != 0) { return colorCompare; } - if (xEntity is EntitySuperAirbus xEntityAirbus && yEntity is EntitySuperAirbus yEntityAirbus) + if (xEntityPlane is EntitySuperAirbus xAirbus && yEntityPlane is EntitySuperAirbus yAirbus) { - var addColorCompare = xEntityAirbus.AddColor.ToArgb().CompareTo(yEntityAirbus.AddColor.ToArgb()); + var dopColorCompare = xAirbus.AddColor.ToArgb().CompareTo(yAirbus.AddColor.ToArgb()); - if(addColorCompare != 0) + if (dopColorCompare != 0) { - return addColorCompare; + return dopColorCompare; } } diff --git a/Airbus/Airbus/PlaneCompareByType.cs b/Airbus/Airbus/PlaneCompareByType.cs index 3524e2f..bf93c01 100644 --- a/Airbus/Airbus/PlaneCompareByType.cs +++ b/Airbus/Airbus/PlaneCompareByType.cs @@ -21,7 +21,7 @@ namespace Airbus return 1; } - if(x != null && y != null) + if(x != null && y == null) { return -1; } @@ -41,7 +41,7 @@ namespace Airbus if(xPlane != null && yPlane == null) { - return 1; + return -1; } if(xPlane.GetPlane.GetType().Name != yPlane.GetPlane.GetType().Name) @@ -51,7 +51,7 @@ namespace Airbus return -1; } - return -1; + return 1; } var speedCompare = xPlane.GetPlane.Airbus.Speed.CompareTo(yPlane.GetPlane.Airbus.Speed); diff --git a/Airbus/Airbus/SaveData.txt b/Airbus/Airbus/SaveData.txt index bcb8f5d..608f1fd 100644 --- a/Airbus/Airbus/SaveData.txt +++ b/Airbus/Airbus/SaveData.txt @@ -1,2 +1,2 @@ MapsCollection -345|DesertStormMap|1000:750:Black:Yellow:False:True;1010:760:Yellow;1005:755:Lime; +345|DesertStormMap|1000:750:White:Gray:True:True;1000:750:DeepPink:Yellow:False:True;1001:751:Red;1000:750:Red;1005:755:Lime;1010:760:Yellow;1000:750:Black:Yellow:True:False;