예제 #1
0
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            if (obj is Knight)
            {
                return(CurrentLocation.Equals(((Knight)obj).CurrentLocation));
            }

            return(false);
        }
예제 #2
0
        /// <summary>
        /// Returns true if Team instances are equal
        /// </summary>
        /// <param name="other">Instance of Team to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Team other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Uuid == other.Uuid ||
                     Uuid != null &&
                     Uuid.Equals(other.Uuid)
                     ) &&
                 (
                     Code == other.Code ||
                     Code != null &&
                     Code.Equals(other.Code)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     DefaultLocation == other.DefaultLocation ||
                     DefaultLocation != null &&
                     DefaultLocation.Equals(other.DefaultLocation)
                 ) &&
                 (
                     CurrentLocation == other.CurrentLocation ||
                     CurrentLocation != null &&
                     CurrentLocation.Equals(other.CurrentLocation)
                 ) &&
                 (
                     Members == other.Members ||
                     Members != null &&
                     Members.SequenceEqual(other.Members)
                 ));
        }