/// <summary> /// Checks whether two players are equal in their information /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(Player other) { if (other == null) { return(false); } bool n = (name != null && name.Equals(other.name)) || (name == null && other.name == null); bool t = (team != null && team.Equals(other.team)) || (team == null && other.team == null); bool e = eligibility.Equals(other.eligibility); bool b = byeWeek - other.byeWeek == 0; bool p = projected - other.projected < 0.1; bool pos = position.Equals(other.position); return(n && t && e && b && p && pos); }
/// <summary> /// Returns true if ProtectionEligibility instances are equal /// </summary> /// <param name="other">Instance of ProtectionEligibility to be compared</param> /// <returns>Boolean</returns> public bool Equals(ProtectionEligibility other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Eligibility == other.Eligibility || Eligibility != null && Eligibility.Equals(other.Eligibility) ) && ( Type == other.Type || Type != null && Type.Equals(other.Type) )); }