コード例 #1
0
        //public override void Notify(IResponseNotifier notifier, ResponeCommMessage msg)
        //{
        //    notifier.Notify(OriginalMsg, this);
        //}

        public override bool Equals(CommunicationMessage other)
        {
            if (other != null && other.GetType() == typeof(JoinResponseCommMessage))
            {
                var afterCasting = (JoinResponseCommMessage)other;
                return(Success == afterCasting.Success && OriginalMsg.Equals(afterCasting.OriginalMsg) &&
                       UserId == afterCasting.UserId && GameData.Equals(afterCasting.GameData));
            }
            return(false);
        }
コード例 #2
0
        //public override void Notify(IResponseNotifier notifier, ResponeCommMessage msg)
        //{
        //    notifier.Notify(OriginalMsg, this);
        //}

        public override bool Equals(CommunicationMessage other)
        {
            if (other != null && other.GetType() == typeof(SearchResponseCommMessage))
            {
                var afterCasting = (SearchResponseCommMessage)other;
                return(Success == afterCasting.Success && OriginalMsg.Equals(afterCasting.OriginalMsg) &&
                       UserId == afterCasting.UserId &&
                       Games.TrueForAll(g => afterCasting.Games.Contains(g)));
            }
            return(false);
        }
コード例 #3
0
        //public override void Notify(IResponseNotifier notifier, ResponeCommMessage msg)
        //{
        //    notifier.Notify(OriginalMsg, this);
        //}

        public override bool Equals(CommunicationMessage other)
        {
            if (other != null && other.GetType() == typeof(ChatResponceCommMessage))
            {
                var afterCasting = (ChatResponceCommMessage)other;
                return(Success == afterCasting.Success && OriginalMsg.Equals(afterCasting.OriginalMsg) &&
                       UserId == afterCasting.UserId && idReciver == afterCasting.idReciver &&
                       roomId == afterCasting.roomId && senderngUsername.Equals(afterCasting.senderngUsername) &&
                       chatType == afterCasting.chatType);
            }
            return(false);
        }
コード例 #4
0
        //public override void Notify(IResponseNotifier notifier, ResponeCommMessage msg)
        //{
        //    notifier.Notify(OriginalMsg, this);
        //}

        public override bool Equals(CommunicationMessage other)
        {
            if (other != null && other.GetType() == typeof(LoginResponeCommMessage))
            {
                var afterCasting = (LoginResponeCommMessage)other;
                return(Success == afterCasting.Success && OriginalMsg.Equals(afterCasting.OriginalMsg) &&
                       UserId == afterCasting.UserId && Name.Equals(afterCasting.Name) &&
                       Username.Equals(afterCasting.Username) && Password.Equals(afterCasting.Password) &&
                       Avatar.Equals(afterCasting.Avatar) && Email.Equals(afterCasting.Email) &&
                       Leauge.Equals(afterCasting.Leauge) && Money == afterCasting.Money);
            }
            return(false);
        }