public override bool Equals(object obj)
{
LineMagnet lm = obj as LineMagnet;
if (lm != null)
{
if (line == null && lm.line == null)
{
if (direction == lm.direction)
return true;
else
return false;
}
else if ((line != null && lm.line == null) || (line == null && lm.line != null))
return false;
else if (line != null && lm.line != null)
return (line == lm.line);
}
return (line == obj);
}