Готовая Лабораторная работа 8
This commit is contained in:
parent
7553b06d96
commit
17895a1d63
@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Tank.DrawningObjects;
|
||||
using Tank.Entities;
|
||||
|
||||
namespace Tank
|
||||
{
|
||||
@ -23,6 +24,10 @@ namespace Tank
|
||||
{
|
||||
return x.Tank.BodyColor.Name.CompareTo(y.Tank.BodyColor.Name);
|
||||
}
|
||||
if (x.GetType() == y.GetType() && x is DrawTank)
|
||||
{
|
||||
return (x.Tank as EntityTank).AdditionalColor.Name.CompareTo((y.Tank as EntityTank).AdditionalColor.Name);
|
||||
}
|
||||
var speedCompare = x.Tank.Speed.CompareTo(y.Tank.Speed);
|
||||
if (speedCompare != 0)
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ namespace Tank
|
||||
public bool Equals(TankCollectionInfo? other)
|
||||
{
|
||||
if (other == null || Name == null || other.Name == null) return false;
|
||||
if (Name == other.Name) return true;
|
||||
if (Name == other?.Name) return true;
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user