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); }
/// <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); }
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 }
public ArtistForArtist(Artist group, Artist member, ArtistLinkType linkType) { Parent = group; Member = member; LinkType = linkType; }
public virtual ArtistForArtist AddMember(Artist member, ArtistLinkType linkType) { ParamIs.NotNull(() => member); return(member.AddGroup(this, linkType)); }