From 60be921810277b9cb4ecdececb06a29a4fa2acac Mon Sep 17 00:00:00 2001 From: shadowik Date: Thu, 15 Dec 2022 06:23:03 +0400 Subject: [PATCH] Final --- .../DoubleDeckerBus/DrawingObjectBus.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/DoubleDeckerBus/DoubleDeckerBus/DrawingObjectBus.cs b/DoubleDeckerBus/DoubleDeckerBus/DrawingObjectBus.cs index b845317..77e7525 100644 --- a/DoubleDeckerBus/DoubleDeckerBus/DrawingObjectBus.cs +++ b/DoubleDeckerBus/DoubleDeckerBus/DrawingObjectBus.cs @@ -74,24 +74,26 @@ namespace DoubleDeckerBus return false; } var bus = _bus.Bus; - var otherCarCar = otherBus._bus.Bus; - if (bus.Speed != otherCarCar.Speed) + var otherBusBus = otherBus._bus.Bus; + if (bus.GetType().Name != otherBusBus.GetType().Name) { return false; } - if (bus.Weight != otherCarCar.Weight) + if (bus.Speed != otherBusBus.Speed) { return false; } - if (bus.BodyColor != otherCarCar.BodyColor) + if (bus.Weight != otherBusBus.Weight) + { + return false; + } + if (bus.BodyColor != otherBusBus.BodyColor) { return false; } - if (bus is EntityDDB DDB) { - if (other is not EntityDDB otherDDB) { - return false; - } + if (bus is EntityDDB DDB && otherBusBus is EntityDDB otherDDB) + { if (DDB.Ledder != otherDDB.Ledder) { return false; @@ -105,6 +107,7 @@ namespace DoubleDeckerBus { return false; } + } return true;