RoomInfo.GetHashCode C# (CSharp) Méthode

GetHashCode() public méthode

Accompanies Equals, using the name's HashCode as return.
public GetHashCode ( ) : int
Résultat int
    public override int GetHashCode()
    {
        return this.nameField.GetHashCode();
    }

Usage Example

        public override int GetHashCode()
        {
            int hash = 1;

            if (roomInfo_ != null)
            {
                hash ^= RoomInfo.GetHashCode();
            }
            hash ^= cards_.GetHashCode();
            hash ^= playerInfos_.GetHashCode();
            if (RoomState != 0)
            {
                hash ^= RoomState.GetHashCode();
            }
            if (WhoseTurn != 0)
            {
                hash ^= WhoseTurn.GetHashCode();
            }
            if (LeftCardCount != 0)
            {
                hash ^= LeftCardCount.GetHashCode();
            }
            if (LeftTurnTime != 0F)
            {
                hash ^= LeftTurnTime.GetHashCode();
            }
            if (LastPlayedCardId != 0)
            {
                hash ^= LastPlayedCardId.GetHashCode();
            }
            return(hash);
        }