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()