Aselia.Core.Channel.CheckRank C# (CSharp) Method

CheckRank() private method

private CheckRank ( UserBase user, ChannelModeAttribute attr ) : bool
user UserBase
attr ChannelModeAttribute
return bool
        private bool CheckRank(UserBase user, ChannelModeAttribute attr)
        {
            if (attr.Prefix == null)
            {
                return true;
            }

            switch (attr.Prefix.Value)
            {
            case '~':
                return user.IsOwner(this);

            case '&':
                return user.IsProtect(this);

            case '@':
                return user.IsOperator(this);

            case '%':
                return user.IsHalfOperator(this);

            case '+':
                return user.IsVoice(this);

            default:
                return false;
            }
        }