Exemplo n.º 1
0
        public virtual ArtistForArtist AddGroup(Artist grp, ArtistLinkType linkType)
        {
            ParamIs.NotNull(() => grp);

            var link = new ArtistForArtist(grp, this, linkType);

            AllGroups.Add(link);
            grp.AllMembers.Add(link);

            return(link);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Whether artist type can have artist links of a specified type and direction.
        /// </summary>
        /// <param name="artistType">Artist type to be tested.</param>
        /// <param name="linkType">Link type.</param>
        /// <param name="direction">Link direction.</param>
        /// <returns>True if the artist type can have artist links, otherwise false.</returns>
        public static bool CanHaveRelatedArtists(ArtistType artistType, ArtistLinkType linkType, LinkDirection direction)
        {
            if (artistType == ArtistType.Unknown)
            {
                return(true);
            }

            if (linkType == ArtistLinkType.Group)
            {
                return(direction == LinkDirection.ManyToOne || GroupTypes.Contains(artistType));
            }

            return(direction == LinkDirection.ManyToOne ? VocalistTypes.Contains(artistType) : !VocalistTypes.Contains(artistType) || artistType == ArtistType.OtherVocalist);
        }
Exemplo n.º 3
0
        public virtual IEnumerable <Artist> ArtistLinksOfType(ArtistLinkType linkType, LinkDirection direction, bool allowInheritance = false)
        {
            if (!ArtistHelper.CanHaveRelatedArtists(ArtistType, linkType, direction))
            {
                return(Enumerable.Empty <Artist>());
            }

            var result = (direction == LinkDirection.ManyToOne ? Groups : Members)
                         .Where(g => g.LinkType == linkType)
                         .Select(g => g.GetArtist(direction));

            // ReSharper disable PossibleMultipleEnumeration
            return(allowInheritance && BaseVoicebank != null && !result.Any()
                                ? BaseVoicebank.ArtistLinksOfType(linkType, direction, true)
                                : result);
            // ReSharper restore PossibleMultipleEnumeration
        }
Exemplo n.º 4
0
 public ArtistForArtist(Artist group, Artist member, ArtistLinkType linkType)
 {
     Parent   = group;
     Member   = member;
     LinkType = linkType;
 }
Exemplo n.º 5
0
        public virtual ArtistForArtist AddMember(Artist member, ArtistLinkType linkType)
        {
            ParamIs.NotNull(() => member);

            return(member.AddGroup(this, linkType));
        }