From 68170b102378da8c38c6804c85bebf7270e1f070 Mon Sep 17 00:00:00 2001 From: VictoriaPresnyakova Date: Sun, 4 Dec 2022 17:50:08 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B2=20=D1=81=D0=BB=D1=83=D1=87=D0=B0=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=B4=D0=B2=D0=B8=D0=BD=D1=83=D1=82=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=D0=BE=D0=B1=D1=8A=D0=B5=D0=BA=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Catamaran/Catamaran.csproj | 1 + Catamaran/DrawingObjectBoat.cs | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Catamaran/Catamaran.csproj b/Catamaran/Catamaran.csproj index 98665cd..1638fd3 100644 --- a/Catamaran/Catamaran.csproj +++ b/Catamaran/Catamaran.csproj @@ -206,6 +206,7 @@ + diff --git a/Catamaran/DrawingObjectBoat.cs b/Catamaran/DrawingObjectBoat.cs index 1758dd6..bc3fcf9 100644 --- a/Catamaran/DrawingObjectBoat.cs +++ b/Catamaran/DrawingObjectBoat.cs @@ -47,7 +47,18 @@ namespace Catamaran { return false; } - // TODO доделать проверки в случае продвинутого объекта + + //доделать проверки в случае продвинутого объекта + + var catamaran = boat as EntityCatamaran; + var otherCatamaran = otherBoatBoat as EntityCatamaran; + + if (catamaran == null && otherCatamaran == null) return true; + if (catamaran == null || otherCatamaran == null) return false; + if (catamaran.DopColor != otherCatamaran.DopColor) return false; + if (catamaran.Sail != otherCatamaran.Sail) return false; + if (catamaran.Floats != otherCatamaran.Floats) return false; + return true; } public void MoveObject(Direction direction)