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;