Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Artist ImagineDragons = new Artist("ImagineDragons");
            Album  origins        = new Album("origins", 2018, "Rock", "Aternative Rock");
            Album  nightVision    = new Album("nightVisions", 2012, "Rock", "Indie Rock");

            Track t1 = new Track("ImagineDragons", "origins", "Natural");
            Track t2 = new Track("ImagineDragons", "origins", "Boomerang");
            Track t3 = new Track("ImagineDragons", "origins", "Machine");
            Track t4 = new Track("ImagineDragons", "origins", "Machine");

            origins.addTrack(t1);
            origins.addTrack(t2);
            origins.addTrack(t3);
            origins.addTrack(t4);

            ImagineDragons.AddAlbum(origins);

            Track t5 = new Track("ImagineDragons", "nightVisions", "Radioactive");
            Track t6 = new Track("ImagineDragons", "nightVisions", "Tiptoe");
            Track t7 = new Track("ImagineDragons", "nightVisions", "Demons");
            Track t8 = new Track("ImagineDragons", "nightVisions", "Amsterdam");

            nightVision.addTrack(t5);
            nightVision.addTrack(t6);
            nightVision.addTrack(t7);
            nightVision.addTrack(t8);

            ImagineDragons.AddAlbum(nightVision);

            Artist PostMelone = new Artist("Post Melone");
            Album  stoney     = new Album("Stoney", 2012, "Rock", "PopRock");

            Track t9  = new Track("Post Melone", "Stoney", "White Iverson");
            Track t10 = new Track("Post Melone", "Stoney", "I Fall Apart");
            Track t11 = new Track("Post Melone", "Stoney", "Go Flex");
            Track t12 = new Track("Post Melone", "Stoney", "Congratulations");

            stoney.addTrack(t9);
            stoney.addTrack(t10);
            stoney.addTrack(t11);
            stoney.addTrack(t12);

            PostMelone.AddAlbum(stoney);

            Collection playlist = new Collection("MyPlaylist");

            playlist.addArtist(ImagineDragons);
            playlist.addArtist(PostMelone);

            Query q = new Query();

            q.search(c: playlist, gen: "");
            //q.searchRock(playlist, "PopRock");
        }
Exemplo n.º 2
0
        private void AlbumAddition(string[] trackInfo, Artist artist, int linenum)
        {
            short year;

            short.TryParse(trackInfo[3].Trim(), out year);

            Genre genre = GetGenre(trackInfo[5].Trim());

            if (genre != null)
            {
                Album album = new Album(trackInfo[2].Trim(), year, genre, artist);
                artist.AddAlbum(album);
                TrackAddition(trackInfo, album);
            }
            else
            {
                Console.WriteLine($"Invalid genre in the track: line {linenum}");
            }
        }
Exemplo n.º 3
0
        static Catalog()
        {
            var placebo         = new Artist("Placebo", AltRock);
            var battleForTheSun = new Album("Battle For The Sun", 2009);

            battleForTheSun.CreateTrack(placebo, "Kitty Litter");
            battleForTheSun.CreateTrack(placebo, "Ashtray Heart");
            battleForTheSun.CreateTrack(placebo, "Battle For The Sun");
            battleForTheSun.CreateTrack(placebo, "For What It's Worth");
            battleForTheSun.CreateTrack(placebo, "Devil in The Details");
            battleForTheSun.CreateTrack(placebo, "Bright Lights");
            battleForTheSun.CreateTrack(placebo, "Speak In Tongues");
            battleForTheSun.CreateTrack(placebo, "The Never-Ending Why");
            battleForTheSun.CreateTrack(placebo, "Julien");
            battleForTheSun.CreateTrack(placebo, "Happy You're Gone");
            battleForTheSun.CreateTrack(placebo, "Breath Underwater");
            battleForTheSun.CreateTrack(placebo, "Come Undone");
            battleForTheSun.CreateTrack(placebo, "Kings Of Medicine");
            placebo.AddAlbum(battleForTheSun);

            var ledZepelin = new Artist("Led Zepelin", HardRock);
            var coda       = new Album("Coda", 1982);

            coda.CreateTrack(ledZepelin, "We're Gonna Groove");
            coda.CreateTrack(ledZepelin, "Poor Tom");
            coda.CreateTrack(ledZepelin, "I Can't Quit You Baby");
            coda.CreateTrack(ledZepelin, "Walter's Walk");
            coda.CreateTrack(ledZepelin, "Ozone Baby");
            coda.CreateTrack(ledZepelin, "Darlene");
            coda.CreateTrack(ledZepelin, "Bonzo's Montreux");
            coda.CreateTrack(ledZepelin, "Wearing and Tearing");
            ledZepelin.AddAlbum(coda);

            AddArtist(placebo);
            AddArtist(ledZepelin);
        }