This commit is contained in:
shadowik 2022-12-15 06:23:03 +04:00
parent 85f5d7f093
commit 60be921810

View File

@ -74,24 +74,26 @@ namespace DoubleDeckerBus
return false; return false;
} }
var bus = _bus.Bus; var bus = _bus.Bus;
var otherCarCar = otherBus._bus.Bus; var otherBusBus = otherBus._bus.Bus;
if (bus.Speed != otherCarCar.Speed) if (bus.GetType().Name != otherBusBus.GetType().Name)
{ {
return false; return false;
} }
if (bus.Weight != otherCarCar.Weight) if (bus.Speed != otherBusBus.Speed)
{ {
return false; return false;
} }
if (bus.BodyColor != otherCarCar.BodyColor) if (bus.Weight != otherBusBus.Weight)
{
return false;
}
if (bus.BodyColor != otherBusBus.BodyColor)
{ {
return false; return false;
} }
if (bus is EntityDDB DDB) { if (bus is EntityDDB DDB && otherBusBus is EntityDDB otherDDB)
if (other is not EntityDDB otherDDB) { {
return false;
}
if (DDB.Ledder != otherDDB.Ledder) { if (DDB.Ledder != otherDDB.Ledder) {
return false; return false;
@ -105,6 +107,7 @@ namespace DoubleDeckerBus
{ {
return false; return false;
} }
} }
return true; return true;