Example #1
0
        public override int GetHashCode()
        {
            unchecked
            {
                // Choose large primes to avoid hashing collisions
                const int HashingBase       = (int)2166136261;
                const int HashingMultiplier = 16777619;

                int hash = HashingBase;
                hash = (hash * HashingMultiplier) ^ Type.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Start.GetHashCode();
                hash = (hash * HashingMultiplier) ^ RoomName?.GetHashCode() ?? 0;
                hash = (hash * HashingMultiplier) ^ Lesson?.GetHashCode() ?? 0;
                hash = (hash * HashingMultiplier) ^ Teachers?.GetTrueHashCode() ?? 0;
                hash = (hash * HashingMultiplier) ^ Groups?.GetTrueHashCode() ?? 0;
                return(hash);
            }
        }
Example #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (RoomName.Length != 0)
            {
                hash ^= RoomName.GetHashCode();
            }
            if (RoomId != 0L)
            {
                hash ^= RoomId.GetHashCode();
            }
            if (CreateTime != 0L)
            {
                hash ^= CreateTime.GetHashCode();
            }
            if (CurPlayerCount != 0)
            {
                hash ^= CurPlayerCount.GetHashCode();
            }
            if (MaxPlayerCount != 0)
            {
                hash ^= MaxPlayerCount.GetHashCode();
            }
            if (Creator != 0L)
            {
                hash ^= Creator.GetHashCode();
            }
            if (IsRunning != false)
            {
                hash ^= IsRunning.GetHashCode();
            }
            if (IsRemove != false)
            {
                hash ^= IsRemove.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Example #3
0
    public override int GetHashCode()
    {
        int hash = 1;

        if (Key.Length != 0)
        {
            hash ^= Key.GetHashCode();
        }
        if (Type != 0)
        {
            hash ^= Type.GetHashCode();
        }
        if (Broadcast != false)
        {
            hash ^= Broadcast.GetHashCode();
        }
        if (Name.Length != 0)
        {
            hash ^= Name.GetHashCode();
        }
        if (Avatar.Length != 0)
        {
            hash ^= Avatar.GetHashCode();
        }
        if (Seat != 0)
        {
            hash ^= Seat.GetHashCode();
        }
        if (RoomKey.Length != 0)
        {
            hash ^= RoomKey.GetHashCode();
        }
        if (RoomName.Length != 0)
        {
            hash ^= RoomName.GetHashCode();
        }
        if (Message.Length != 0)
        {
            hash ^= Message.GetHashCode();
        }
        if (BeginPoint != 0D)
        {
            hash ^= BeginPoint.GetHashCode();
        }
        if (EndPoint != 0D)
        {
            hash ^= EndPoint.GetHashCode();
        }
        if (PenSize != 0)
        {
            hash ^= PenSize.GetHashCode();
        }
        if (Color != 0)
        {
            hash ^= Color.GetHashCode();
        }
        hash ^= users_.GetHashCode();
        hash ^= rooms_.GetHashCode();
        if (Code != 0)
        {
            hash ^= Code.GetHashCode();
        }
        if (Error.Length != 0)
        {
            hash ^= Error.GetHashCode();
        }
        if (Id != 0)
        {
            hash ^= Id.GetHashCode();
        }
        return(hash);
    }
Example #4
0
 public override int GetHashCode()
 {
     return(RoomName != null ? RoomName.GetHashCode() : 0);
 }