static void Main(string[] args) { Search s = new Search(); // List<Playlist> play = new List<Playlist>(); /*---------------------------------------------------------------- Каталог------------------------------------------------------------ */ //Рок и его поджанры Genre rock = new Genre("рок"); s.addGenre(rock); Genre Post_Hardcore = new Genre("пост-хардкор"); s.addGenre(Post_Hardcore); rock.addUnder(Post_Hardcore); Genre alternative = new Genre("альтернатива"); s.addGenre(alternative); rock.addUnder(alternative); //Шансон Genre shanson = new Genre("шансон"); s.addGenre(shanson); //Исполнители рока Artist linkin_park = new Artist("Linkin Park", rock); s.addArtist(linkin_park); Artist Nirvana = new Artist("Nirvana", rock); s.addArtist(Nirvana); Artist Rammstein = new Artist("Rammstein", rock); s.addArtist(Rammstein); Artist wildways = new Artist("Wildways", Post_Hardcore); s.addArtist(wildways); Artist Our_Last_Night = new Artist("Our Last Night", Post_Hardcore); s.addArtist(Our_Last_Night); Artist Bmth = new Artist("Bring Me The Horizon", Post_Hardcore); s.addArtist(Bmth); /* Artist papa_roach = new Artist("Papa Roach", alternative); * s.addArtist(papa_roach);*/ Artist fob = new Artist("Fall Out Boy", alternative); s.addArtist(fob); /* Artist score = new Artist("The Score", alternative); * s.addArtist(score);*/ //Исполнители шансона Artist Mikhail_Krug = new Artist("Михаил Круг", shanson); s.addArtist(Mikhail_Krug); Artist Aleksandr_Rozenbaum = new Artist("Александр Розенбаум", shanson); s.addArtist(Aleksandr_Rozenbaum); Artist Leps = new Artist("Григорий Лепы", shanson); s.addArtist(Leps); //Альбомы и треки Linkin Park Album Hybrid_Theory = new Album("Hybrid Theory", linkin_park, 2000, rock); linkin_park.addAlbum(Hybrid_Theory); //Треки альбома Song in_the_end = new Song("In The End", linkin_park, Hybrid_Theory, 2000); linkin_park.addSong(in_the_end); Hybrid_Theory.addSong(in_the_end); Song crawling = new Song("Crawling", linkin_park, Hybrid_Theory, 2000); linkin_park.addSong(crawling); Hybrid_Theory.addSong(crawling); Song one_step_closer = new Song("One Step Closer", linkin_park, Hybrid_Theory, 2000); linkin_park.addSong(one_step_closer); Hybrid_Theory.addSong(one_step_closer); Album Meteora = new Album("Meteora", linkin_park, 2003, rock); linkin_park.addAlbum(Meteora); //Треки альбома Song numb = new Song("Numb", linkin_park, Meteora, 2003); linkin_park.addSong(numb); Meteora.addSong(numb); Song faint = new Song("Faint", linkin_park, Meteora, 2003); linkin_park.addSong(faint); Meteora.addSong(faint); Song somewhere_i_belong = new Song("Somewhere I Belong", linkin_park, Meteora, 2003); linkin_park.addSong(somewhere_i_belong); Meteora.addSong(somewhere_i_belong); //Сингл Album New_Divide = new Album("New Divide", linkin_park, 2009, rock); linkin_park.addAlbum(New_Divide); Song New_Divide_song = new Song("New Divide", linkin_park, New_Divide, 2009); linkin_park.addSong(New_Divide_song); New_Divide.addSong(New_Divide_song); //Альбомы и треки Nirvna Album nevermind = new Album("Nevermind", Nirvana, 1991, rock); Nirvana.addAlbum(nevermind); //Треки альбома Song smells = new Song("Smells Like Teen Spirit", Nirvana, nevermind, 1991); Nirvana.addSong(smells); nevermind.addSong(smells); Song breed = new Song("Breed", Nirvana, nevermind, 1991); Nirvana.addSong(breed); nevermind.addSong(breed); Song polly = new Song("Polly", Nirvana, nevermind, 1991); Nirvana.addSong(polly); nevermind.addSong(polly); //Альбомы и треки Wildways Album New_School = new Album("Нью Скул", wildways, 2019, Post_Hardcore); wildways.addAlbum(New_School); //Треки альбома Song echo = new Song("Эхо", wildways, New_School, 2019); wildways.addSong(echo); New_School.addSong(echo); Song fear = new Song("Страх", wildways, New_School, 2019); wildways.addSong(fear); New_School.addSong(fear); Song darkness = new Song("Мрак", wildways, New_School, 2019); wildways.addSong(darkness); New_School.addSong(darkness); Album day_x = new Album("Day X", wildways, 2018, Post_Hardcore); wildways.addAlbum(day_x); //Треки альбома Song self_riot = new Song("Self Riot", wildways, day_x, 2018); wildways.addSong(self_riot); day_x.addSong(self_riot); Song Lost_w = new Song("Lost", wildways, day_x, 2018); wildways.addSong(Lost_w); day_x.addSong(Lost_w); Song puzzle = new Song("Puzzle", wildways, day_x, 2018); wildways.addSong(puzzle); day_x.addSong(puzzle); //Сингл Album kilometri = new Album("Километры", wildways, 2019, Post_Hardcore); wildways.addAlbum(kilometri); Song kilometri_song = new Song("Километры", wildways, kilometri, 2019); wildways.addSong(kilometri_song); kilometri.addSong(kilometri_song); //Альбомы и треки Our Las Night Album overcome_the_darkness = new Album("Overcome The Darkness", Our_Last_Night, 2019, Post_Hardcore); Our_Last_Night.addAlbum(overcome_the_darkness); //Треки альбома Song Lost_o = new Song("Lost", Our_Last_Night, overcome_the_darkness, 2019); Our_Last_Night.addSong(Lost_o); overcome_the_darkness.addSong(Lost_o); Song when_human = new Song("When Human Become Our Gods", Our_Last_Night, overcome_the_darkness, 2019); Our_Last_Night.addSong(when_human); overcome_the_darkness.addSong(when_human); Song losing_sleep = new Song("Losing Sleep", Our_Last_Night, overcome_the_darkness, 2019); Our_Last_Night.addSong(losing_sleep); overcome_the_darkness.addSong(losing_sleep); Album oak_island = new Album("Oak Island", Our_Last_Night, 2013, Post_Hardcore); Our_Last_Night.addAlbum(oak_island); //Треки альбома Song sunrise = new Song("Sunrise", Our_Last_Night, oak_island, 2013); Our_Last_Night.addSong(sunrise); oak_island.addSong(sunrise); Song same_old_war = new Song("Same Old War", Our_Last_Night, oak_island, 2013); Our_Last_Night.addSong(same_old_war); oak_island.addSong(same_old_war); Song reality = new Song("Reality Without You", Our_Last_Night, oak_island, 2013); Our_Last_Night.addSong(reality); oak_island.addSong(reality); //Альбомы и треки Bring Me The Horizon Album sempiternal = new Album("Sempiternal", Bmth, 2013, Post_Hardcore); Bmth.addAlbum(sempiternal); //Треки альбома Song can_you = new Song("Can You Feel My Heart", Bmth, sempiternal, 2013); Bmth.addSong(can_you); sempiternal.addSong(can_you); Song sleepwalking = new Song("SleepWalking", Bmth, sempiternal, 2013); Bmth.addSong(sleepwalking); sempiternal.addSong(sleepwalking); Song shadow = new Song("Shadow Moses", Bmth, sempiternal, 2013); Bmth.addSong(shadow); sempiternal.addSong(shadow); Album Thats_The_spirit = new Album("That's The Spirit", Bmth, 2015, Post_Hardcore); Bmth.addAlbum(Thats_The_spirit); //Треки альбома Song Throne = new Song("Throne", Bmth, Thats_The_spirit, 2015); Bmth.addSong(Throne); Thats_The_spirit.addSong(Throne); Song run = new Song("Run", Bmth, Thats_The_spirit, 2015); Bmth.addSong(run); Thats_The_spirit.addSong(run); Song Avalanche = new Song("Avalanche", Bmth, Thats_The_spirit, 2015); Bmth.addSong(Avalanche); Thats_The_spirit.addSong(Avalanche); //Сингл Album Ludens = new Album("Ludens", Bmth, 2019, Post_Hardcore); Bmth.addAlbum(Ludens); Song ludens_song = new Song("Ludens", Bmth, Thats_The_spirit, 2019); Bmth.addSong(ludens_song); Ludens.addSong(ludens_song); // Сингл fall out boy Album Centuries = new Album("Centuries", fob, 2014, alternative); fob.addAlbum(Centuries); Song centuries_song = new Song("Centuries", fob, Centuries, 2014); fob.addSong(centuries_song); Centuries.addSong(centuries_song); //Альбом Михаила Круга Album madam = new Album("Мадам", Mikhail_Krug, 1998, shanson); Mikhail_Krug.addAlbum(madam); Song central = new Song("Владимирский централ", Mikhail_Krug, madam, 1998); Mikhail_Krug.addSong(central); madam.addSong(central); //альбом Лепса Album na_strunah = new Album("На струнах дождя...", Leps, 2002, shanson); Leps.addAlbum(na_strunah); Song rumka = new Song("Рюмка водки на столе", Leps, na_strunah, 2002); Leps.addSong(rumka); na_strunah.addSong(rumka); //Альбом Александра Розенбаума Album Anatologia = new Album("Анатология 1", Aleksandr_Rozenbaum, 1981, shanson); Aleksandr_Rozenbaum.addAlbum(Anatologia); Song gopstop = new Song("Гоп-стоп", Aleksandr_Rozenbaum, Anatologia, 1981); Aleksandr_Rozenbaum.addSong(gopstop); Anatologia.addSong(gopstop); //добавление списка албомов и треков методом проверки испонителей s.runArtists(); /*-------------------------------------------------------------------- Конец каталога --------------------------------------------------*/ /*--------------------------------------------------------------------------Меню--------------------------------------------------------*/ menu m = new menu(s); m.work(); }
public void work() { Console.WriteLine(" Выберете нужную цифру: "); uint s = 10000; while (s != 0) { string input = Console.ReadLine(); if (UInt32.TryParse(input, out s)) { if (s <= 12) { switch (s) { case 1: m = new menu(catalog); break; case 2: catalog.showall(); Console.WriteLine("\n\nВведите 1 чтобы получить спраку по функциям меню: "); break; case 3: catalog.showAllAlbums(); Console.WriteLine("\n\nВведите 1 чтобы получить спраку по функциям меню: "); break; case 4: catalog.showAllSongs(); Console.WriteLine("\n\nВведите 1 чтобы получить спраку по функциям меню: "); break; case 5: showPlay(); Console.WriteLine("\n\nВведите 1 чтобы получить спраку по функциям меню: "); break; case 6: Console.Write("Введите имя исполнителя: "); string singer = Console.ReadLine(); if (catalog.searchSinger(singer)) { Artist artist = catalog.getArtistforName(singer); artist.show(); artist.showAlbums(); } else { Console.WriteLine("Такого исполнителя нет в каталоге"); } Console.WriteLine("\n\nВведите 1 чтобы получить спраку по функциям меню: "); break; case 7: Console.Write("Введите название альбома: "); string album = Console.ReadLine(); if (catalog.searchAlbum(album)) { Album tmp = catalog.getAlbumforName(album); tmp.show(); } else { Console.WriteLine("Такого альбома нет в каталоге"); } Console.WriteLine("\n\nВведите 1 чтобы получить спраку по функциям меню: "); break; case 8: Console.Write("Введите название жанра: "); string genre = Console.ReadLine(); Genre gen = catalog.getGenreforName(genre); catalog.showGenreSongs(gen); Console.WriteLine("\n\nВведите 1 чтобы получить спраку по функциям меню: "); break; case 9: Console.Write("Введите название плейлиста: "); string nameofplay = Console.ReadLine(); Playlist playlist = new Playlist(nameofplay); play.Add(playlist); Console.WriteLine("\n\nВведите 1 чтобы получить спраку по функциям меню: "); break; case 10: Console.Write("Введите название плейлиста: "); string nameofplay3 = Console.ReadLine(); if (searchPlay(nameofplay3)) { Playlist playlist1 = GetPlaylist(nameofplay3); Console.Write("Введите название трека: "); string songname = Console.ReadLine(); if (catalog.searchSong(songname)) { Song song = catalog.getSongforName(songname); playlist1.addSong(song); } else { Console.WriteLine("Такого трека не существует"); } } else { Console.WriteLine("Такого плейлиста не существует"); } Console.WriteLine("\n\nВведите 1 чтобы получить спраку по функциям меню: "); break; case 11: Console.Write("Введите название плейлиста: "); string nameofplay2 = Console.ReadLine(); if (searchPlay(nameofplay2)) { Playlist playlist1 = GetPlaylist(nameofplay2); playlist1.show(); } else { Console.WriteLine("Такого плейлиста не существует"); } Console.WriteLine("\n\nВведите 1 чтобы получить спраку по функциям меню: "); break; case 12: s = 0; break; } } else { Console.WriteLine("Такой функции нет"); } } else { Console.WriteLine("ErrorTypes"); } } }