Готовая лабораторная работа 8
This commit is contained in:
parent
c1eb01d491
commit
7553b06d96
@ -21,7 +21,7 @@ namespace Tank
|
|||||||
{
|
{
|
||||||
throw new ArgumentNullException(nameof(y));
|
throw new ArgumentNullException(nameof(y));
|
||||||
}
|
}
|
||||||
if (x.GetType() != y.GetType())
|
if (x.GetType().Name != y.GetType().Name)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -39,6 +39,14 @@ namespace Tank
|
|||||||
}
|
}
|
||||||
if (x is DrawTank && y is DrawTank)
|
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)
|
if ((x.Tank as EntityTank).AdditionalColor != (y.Tank as EntityTank).AdditionalColor)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -27,14 +27,14 @@ namespace Tank
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
panelCyan.MouseDown += panelColor_MouseDown;
|
panelSilver.MouseDown += panelColor_MouseDown;
|
||||||
panelRed.MouseDown += panelColor_MouseDown;
|
panelRed.MouseDown += panelColor_MouseDown;
|
||||||
panelOrange.MouseDown += panelColor_MouseDown;
|
panelOrange.MouseDown += panelColor_MouseDown;
|
||||||
panelYellow.MouseDown += panelColor_MouseDown;
|
panelYellow.MouseDown += panelColor_MouseDown;
|
||||||
panelGreen.MouseDown += panelColor_MouseDown;
|
panelGreen.MouseDown += panelColor_MouseDown;
|
||||||
|
panelCyan.MouseDown += panelColor_MouseDown;
|
||||||
panelBlue.MouseDown += panelColor_MouseDown;
|
panelBlue.MouseDown += panelColor_MouseDown;
|
||||||
panelPink.MouseDown += panelColor_MouseDown;
|
panelPink.MouseDown += panelColor_MouseDown;
|
||||||
panelSilver.MouseDown += panelColor_MouseDown;
|
|
||||||
|
|
||||||
defaultColor = labelColor.BackColor;
|
defaultColor = labelColor.BackColor;
|
||||||
buttonCancel.Click += (s, e) => Close();
|
buttonCancel.Click += (s, e) => Close();
|
||||||
|
@ -21,9 +21,7 @@ namespace Tank
|
|||||||
{
|
{
|
||||||
if (other == null || Name == null || other.Name == null) return false;
|
if (other == null || Name == null || other.Name == null) return false;
|
||||||
if (Name == other.Name) return true;
|
if (Name == other.Name) return true;
|
||||||
|
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
//return Name.Equals(other.Name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
|
Loading…
Reference in New Issue
Block a user