/// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked             // Overflow is fine, just wrap
            {
                int hashCode = 41;
                // Suitable nullity checks etc, of course :)

                hashCode = hashCode * 59 + EnergyCubes.GetHashCode();

                hashCode = hashCode * 59 + Health.GetHashCode();

                hashCode = hashCode * 59 + Active.GetHashCode();

                hashCode = hashCode * 59 + Virtual.GetHashCode();

                hashCode = hashCode * 59 + Priority.GetHashCode();

                hashCode = hashCode * 59 + OnTurn.GetHashCode();

                hashCode = hashCode * 59 + IsMine.GetHashCode();

                hashCode = hashCode * 59 + HandCards.GetHashCode();

                hashCode = hashCode * 59 + Attitude.GetHashCode();

                hashCode = hashCode * 59 + Type.GetHashCode();
                return(hashCode);
            }
        }
示例#2
0
        /// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked             // Overflow is fine, just wrap
            {
                int hashCode = 41;
                // Suitable nullity checks etc, of course :)

                hashCode = hashCode * 59 + Id.GetHashCode();
                if (ControlledEntities != null)
                {
                    hashCode = hashCode * 59 + ControlledEntities.GetHashCode();
                }

                hashCode = hashCode * 59 + OnTurn.GetHashCode();

                hashCode = hashCode * 59 + Active.GetHashCode();
                if (DisplayName != null)
                {
                    hashCode = hashCode * 59 + DisplayName.GetHashCode();
                }
                return(hashCode);
            }
        }