namespace Model.Stub;

public class StubArtist
{
    public List<Artist> Artists
    {
        get => artists;
    }

    private readonly List<Artist> artists;

    public StubArtist()
    {
        Artist Artiste1 = new Artist("Critien");
        Artist Artiste2 = new Artist("Gouriet");
        Artist Artiste3 = new Artist("Poulifer");
        Artist Artiste4 = new Artist("Credian");

        artists = new List<Artist>()
        {
            Artiste1, Artiste2, Artiste3, Artiste4
        };
    }

    public List<Artist> GetArtists()
    {
        return artists;
    }
    public Artist? GetArtistByName(string name)
    {
        foreach (var artist in artists)
        {
            if (artist.Name == name)
            {
                return artist;
            }
        }
        return null;
    }
    public void AddArtist(Artist artist)
    {
        artists.Add(artist);
    }
    public void RemoveArtist(Artist artist)
    {
        artists.Remove(artist);
    }
}
