Done
This commit is contained in:
parent
0f3e9f9a46
commit
72dcd86427
@ -26,7 +26,6 @@ namespace Cruiser.Generics
|
|||||||
var speedCompare = x.EntityCruiser.Speed.CompareTo(y.EntityCruiser.Speed);
|
var speedCompare = x.EntityCruiser.Speed.CompareTo(y.EntityCruiser.Speed);
|
||||||
if (speedCompare != 0)
|
if (speedCompare != 0)
|
||||||
return speedCompare;
|
return speedCompare;
|
||||||
|
|
||||||
return x.EntityCruiser.Weight.CompareTo(y.EntityCruiser.Weight);
|
return x.EntityCruiser.Weight.CompareTo(y.EntityCruiser.Weight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ namespace Cruiser.Generics
|
|||||||
var speedCompare = x.EntityCruiser.Speed.CompareTo(y.EntityCruiser.Speed);
|
var speedCompare = x.EntityCruiser.Speed.CompareTo(y.EntityCruiser.Speed);
|
||||||
if (speedCompare != 0)
|
if (speedCompare != 0)
|
||||||
return speedCompare;
|
return speedCompare;
|
||||||
|
|
||||||
return x.EntityCruiser.Weight.CompareTo(y.EntityCruiser.Weight);
|
return x.EntityCruiser.Weight.CompareTo(y.EntityCruiser.Weight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,6 @@ namespace Cruiser
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetHashCode([DisallowNull] DrawningCruiser? obj)
|
public int GetHashCode([DisallowNull] DrawningCruiser? obj)
|
||||||
{
|
{
|
||||||
return obj.GetHashCode();
|
return obj.GetHashCode();
|
@ -203,11 +203,11 @@ namespace Cruiser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void ButtonSortByType_Click(object sender, EventArgs e) => ComparePlanes(new CruiserCompareByType());
|
private void ButtonSortByType_Click(object sender, EventArgs e) => CompareCruiser(new CruiserCompareByType());
|
||||||
|
|
||||||
private void ButtonSortByColor_Click(object sender, EventArgs e) => ComparePlanes(new CruiserCompareByColor());
|
private void ButtonSortByColor_Click(object sender, EventArgs e) => CompareCruiser(new CruiserCompareByColor());
|
||||||
|
|
||||||
private void ComparePlanes(IComparer<DrawningCruiser?> comparer)
|
private void CompareCruiser(IComparer<DrawningCruiser?> comparer)
|
||||||
{
|
{
|
||||||
if (listBoxStorages.SelectedIndex == -1)
|
if (listBoxStorages.SelectedIndex == -1)
|
||||||
{
|
{
|
||||||
|
@ -29,7 +29,6 @@ namespace Cruiser.Generics
|
|||||||
throw new StorageOverflowException(_maxCount);
|
throw new StorageOverflowException(_maxCount);
|
||||||
Insert(cruiser, 0, equal);
|
Insert(cruiser, 0, equal);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Insert(T cruiser, int position, IEqualityComparer<T>? equal = null)
|
public void Insert(T cruiser, int position, IEqualityComparer<T>? equal = null)
|
||||||
{
|
{
|
||||||
if (_places.Count == _maxCount)
|
if (_places.Count == _maxCount)
|
||||||
|
Loading…
Reference in New Issue
Block a user