From 7553b06d968765eb34a2f733699067f9320e18db Mon Sep 17 00:00:00 2001 From: "nikbel2004@outlook.com" Date: Fri, 22 Dec 2023 20:40:53 +0400 Subject: [PATCH] =?UTF-8?q?=D0=93=D0=BE=D1=82=D0=BE=D0=B2=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82=D0=BE=D1=80=D0=BD?= =?UTF-8?q?=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=208?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tank/Tank/DrawiningTankEqutables.cs | 10 +++++++++- Tank/Tank/FormTankConfig.cs | 4 ++-- Tank/Tank/TanksCollectionInfo.cs | 2 -- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Tank/Tank/DrawiningTankEqutables.cs b/Tank/Tank/DrawiningTankEqutables.cs index e8ec238..e91b879 100644 --- a/Tank/Tank/DrawiningTankEqutables.cs +++ b/Tank/Tank/DrawiningTankEqutables.cs @@ -21,7 +21,7 @@ namespace Tank { throw new ArgumentNullException(nameof(y)); } - if (x.GetType() != y.GetType()) + if (x.GetType().Name != y.GetType().Name) { return false; } @@ -39,6 +39,14 @@ namespace Tank } if (x is DrawTank && y is DrawTank) { + if (x.Tank as EntityTank == null) + { + throw new ArgumentNullException(nameof(x)); + } + if (y.Tank as EntityTank == null) + { + throw new ArgumentNullException(nameof(y)); + } if ((x.Tank as EntityTank).AdditionalColor != (y.Tank as EntityTank).AdditionalColor) { return false; diff --git a/Tank/Tank/FormTankConfig.cs b/Tank/Tank/FormTankConfig.cs index 075db9a..b3d82e3 100644 --- a/Tank/Tank/FormTankConfig.cs +++ b/Tank/Tank/FormTankConfig.cs @@ -27,14 +27,14 @@ namespace Tank { InitializeComponent(); - panelCyan.MouseDown += panelColor_MouseDown; + panelSilver.MouseDown += panelColor_MouseDown; panelRed.MouseDown += panelColor_MouseDown; panelOrange.MouseDown += panelColor_MouseDown; panelYellow.MouseDown += panelColor_MouseDown; panelGreen.MouseDown += panelColor_MouseDown; + panelCyan.MouseDown += panelColor_MouseDown; panelBlue.MouseDown += panelColor_MouseDown; panelPink.MouseDown += panelColor_MouseDown; - panelSilver.MouseDown += panelColor_MouseDown; defaultColor = labelColor.BackColor; buttonCancel.Click += (s, e) => Close(); diff --git a/Tank/Tank/TanksCollectionInfo.cs b/Tank/Tank/TanksCollectionInfo.cs index 4b6b3dc..feb68e7 100644 --- a/Tank/Tank/TanksCollectionInfo.cs +++ b/Tank/Tank/TanksCollectionInfo.cs @@ -21,9 +21,7 @@ namespace Tank { if (other == null || Name == null || other.Name == null) return false; if (Name == other.Name) return true; - throw new NotImplementedException(); - //return Name.Equals(other.Name); } public override int GetHashCode()