Canguro.Controller.Snap.LineMagnet.Equals C# (CSharp) Method

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool
        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);
        }