PIbd-21 Belianin N.N. LabWork08 #8

Closed
Belnik wants to merge 3 commits from LabWork08 into LabWork07
3 changed files with 11 additions and 5 deletions
Showing only changes of commit 7553b06d96 - Show all commits

View File

@ -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)
Review

Так через is уже проверили

Так через is уже проверили
{
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;

View File

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

View File

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