示例#1
0
        public void SetUp()
        {
            _circle = CreateArtist(ArtistType.Circle, "S.C.X.");

            _producer  = CreateArtist(ArtistType.Producer, "devilishP");
            _producer2 = CreateArtist(ArtistType.Producer, "40mP");
        }
示例#2
0
        /// <summary>
        /// Gets the sort order for an artist in an artist string.
        /// Determines the order the artist appear in the list.
        /// </summary>
        /// <param name="artistLink">Artist link. Cannot be null.</param>
        /// <param name="focus">Album focus.</param>
        /// <returns>Sort order, 0-based.</returns>
        private int GetSortOrderForArtistString(IArtistLinkWithRoles artistLink, ContentFocus focus)
        {
            var categories = ArtistHelper.GetCategories(artistLink);

            // Animator appears first for animation discs.
            if (focus == ContentFocus.Video && categories.HasFlag(ArtistCategories.Animator))
            {
                return(0);
            }

            if (focus == ContentFocus.Illustration && categories.HasFlag(ArtistCategories.Illustrator))
            {
                return(0);
            }

            // Composer role always appears first
            if (categories.HasFlag(ArtistCategories.Producer) && artistLink.Roles.HasFlag(ArtistRoles.Composer))
            {
                return(1);
            }

            // Other producers appear after composers
            if (categories.HasFlag(ArtistCategories.Producer))
            {
                return(2);
            }

            if (categories.HasFlag(ArtistCategories.Circle) || categories.HasFlag(ArtistCategories.Band))
            {
                return(3);
            }

            return(4);
        }
示例#3
0
        /// <summary>
        /// Whether artist should appear in artist string.
        /// </summary>
        public static bool IsValidCreditableArtist(IArtistLinkWithRoles artist)
        {
            if (artist.IsSupport)
            {
                return(false);
            }

            var cat = GetCategories(artist);

            return(cat != ArtistCategories.Nothing && cat != ArtistCategories.Label);
        }
        public void SetUp()
        {
            _artistStringFactory = new ArtistStringFactory();

            _circle    = CreateArtist(ArtistType.Circle, "S.C.X.");
            _animator  = CreateArtist(ArtistType.Animator, "wakamuraP");
            _producer  = CreateArtist(ArtistType.Producer, "devilishP");
            _producer2 = CreateArtist(ArtistType.Producer, "40mP");
            _producer3 = CreateArtist(ArtistType.Producer, "Clean Tears");
            _producer4 = CreateArtist(ArtistType.Producer, "Tripshots");
            _producers = new[] { _producer, _producer2, _producer3, _producer4 };

            _vocalist  = CreateArtist(ArtistType.Vocaloid, "Hatsune Miku");
            _vocalist2 = CreateArtist(ArtistType.Vocaloid, "Kagamine Rin");
            _vocalist3 = CreateArtist(ArtistType.Vocaloid, "Kagamine Len");
            _vocalist4 = CreateArtist(ArtistType.Vocaloid, "Megurine Luka");
            _vocalists = new[] { _vocalist, _vocalist2, _vocalist3, _vocalist4 };
        }
示例#5
0
 public static bool IsProducerRole(IArtistLinkWithRoles link, ContentFocus focus)
 {
     return(IsProducerRole(GetCategories(link), focus));
 }
示例#6
0
 public static TranslatedString GetTranslatedName(IArtistLinkWithRoles link)
 {
     return(link.Artist != null && string.IsNullOrEmpty(link.Name) ? link.Artist.TranslatedName : TranslatedString.Create(link.Name));
 }
示例#7
0
 public static bool IsProducerRole(IArtistLinkWithRoles link, bool isAnimation)
 {
     return(IsProducerRole(GetCategories(link), isAnimation));
 }
示例#8
0
        public static ArtistCategories GetCategories(IArtistLinkWithRoles artist)
        {
            ParamIs.NotNull(() => artist);

            return(GetCategories(artist.Artist != null ? artist.Artist.ArtistType : ArtistType.Unknown, artist.Roles));
        }