/// <summary> /// Atspausdinama i konsole kas mate daugiausiai filmu, kuriuose vaidina T. Cruise ir N.Kidman. /// </summary> /// <param name="Spectators"></param> /// <param name="max"></param> void CruisAndKidmanSpausdinimas(SpectatorBranch Spectators, int max) { Console.WriteLine("Daugiausiai filmu, kuriose vaidino N. Kidman mate: "); for (int i = 0; i < Spectators.Count; i++) { if (Spectators.GetSpectator(i).CruisKidmanCount == max) { Console.WriteLine("{0} {1}", Spectators.GetSpectator(i).Name, Spectators.GetSpectator(i).CruisKidmanCount); } } }
/// <summary> /// Suranda kiek daugiausiai vienas ziurovas mate filmu kuriuose vaidino T. Cruise ir N.Kidman. /// </summary> /// <param name="Spectators"></param> /// <returns></returns> int CruisAndKidmanMax(SpectatorBranch Spectators) { int max = 0; for (int i = 0; i < Spectators.Count; i++) { if (Spectators.GetSpectator(i).CruisKidmanCount > max) { max = Spectators.GetSpectator(i).CruisKidmanCount; } } return(max); }
/// <summary> /// Suskaiciuoja kiek kuris ziurovas mate filmu kuriuose vaidina N.Kidman. /// </summary> /// <param name="Spectators"></param> void CruisAndKidmanCounter(ref SpectatorBranch Spectators) { Program p = new Program(); for (int i = 0; i < Spectators.Count; i++) { for (int j = 0; j < Spectators.GetSpectator(i).Films.Count; j++) { if (p.CruisAndKidmanIsOrNo(Spectators.GetSpectator(i).Films.GetFilm(j)) == true) { Spectators.GetSpectator(i).CruisKidmanCount++; } } } }
/// <summary> /// Sukuriamas visu filmu konteineris /// </summary> /// <param name="Spectators"></param> /// <returns></returns> FilmContainer AllFilmContainerCreate(SpectatorBranch Spectators) { Program p = new Program(); FilmContainer AllFilms = new FilmContainer(); for (int i = 0; i < Spectators.Count; i++) { for (int j = 0; j < Spectators.GetSpectator(i).Films.Count; j++) { if (p.FilmCheck(AllFilms, Spectators.GetSpectator(i).Films.GetFilm(j))) { AllFilms.AddFilm(Spectators.GetSpectator(i).Films.GetFilm(j)); } } } return(AllFilms); }
/// <summary> /// Surandamas nematytu filmu sarasas, kuris iskart siunciamas atspausdinti /// </summary> /// <param name="Spectators"></param> /// <param name="AllFilms"></param> void Recomendations(SpectatorBranch Spectators, FilmContainer AllFilms) { Program p = new Program(); for (int i = 0; i < Spectators.Count; i++) { FilmContainer UnseenedFilms = new FilmContainer(); string[] unseendedFilmsString = new string[50]; for (int j = 0; j < AllFilms.Count; j++) { if (p.FilmCheck(Spectators.GetSpectator(i).Films, AllFilms.GetFilm(j))) { unseendedFilmsString[UnseenedFilms.Count] = string.Format(AllFilms.GetFilm(j).ToString()); UnseenedFilms.AddFilm(AllFilms.GetFilm(j)); } } p.RecomendationPrint(unseendedFilmsString, Spectators.GetSpectator(i).Name); } }
/// <summary> /// Sukuria WarnerBros sukurtu filmu konteineri /// </summary> /// <param name="Spectators"></param> /// <returns></returns> FilmContainer WarnerBrosContainerCreate(SpectatorBranch Spectators) { string studio = "Warner Bros"; Program p = new Program(); FilmContainer WarnerBrosContainer = new FilmContainer(); for (int i = 0; i < Spectators.Count; i++) { for (int j = 0; j < Spectators.GetSpectator(i).Films.Count; j++) { if (Spectators.GetSpectator(i).Films.GetFilm(j).Studio == studio) { if (p.FilmCheck(WarnerBrosContainer, Spectators.GetSpectator(i).Films.GetFilm(j))) { WarnerBrosContainer.AddFilm(Spectators.GetSpectator(i).Films.GetFilm(j)); } } } } return(WarnerBrosContainer); }