Box2D.Common.Vec2.Equals C# (CSharp) Method

Equals() public method

public Equals ( Object obj ) : bool
obj Object
return bool
        public override bool Equals(Object obj)
        {
            // automatically generated by Eclipse
            if (this == obj)
                return true;
            if (obj == null)
                return false;
            if (GetType() != obj.GetType())
                return false;
            Vec2 other = (Vec2)obj;
            if (FloatToIntBits(X) != FloatToIntBits(other.X))
                return false;
            if (FloatToIntBits(Y) != FloatToIntBits(other.Y))
                return false;
            return true;
        }

Usage Example

Beispiel #1
0
        public override bool Equals(Object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (GetType() != obj.GetType())
            {
                return(false);
            }
            Mat22 other = (Mat22)obj;

            if (Ex == null)
            {
                if (other.Ex != null)
                {
                    return(false);
                }
            }
            else if (!Ex.Equals(other.Ex))
            {
                return(false);
            }
            if (Ey == null)
            {
                if (other.Ey != null)
                {
                    return(false);
                }
            }
            else if (!Ey.Equals(other.Ey))
            {
                return(false);
            }
            return(true);
        }