В проверке на эквивалентность самолетов, добавлены проверки на тип и количество двигателей

This commit is contained in:
Данияр Аглиуллов 2022-11-01 21:30:26 +04:00
parent 9da6b57bd9
commit 5e1f609741

View File

@ -50,7 +50,9 @@ namespace AirBomber
public bool Equals(IDrawningObject? other)
{
if (other is not DrawningObject otherAirplane)
if (other is not DrawningObject otherAirplane ||
_airplane.DrawningEngines?.GetType() != otherAirplane._airplane.DrawningEngines?.GetType() ||
_airplane.DrawningEngines?.CountEngines != otherAirplane._airplane.DrawningEngines?.CountEngines)
{
return false;
}