public void add(Movie movie) { var found = false; for(var i = 0; i<this.movies.Count; i++) { found = movie.title == this.movies[i].title; } if (!found) this.movies.Add(movie); }
public void add(Movie movie) { foreach (var i in all_movies()) { //if (!movie.GetHashCode().Equals(i.GetHashCode())) //{ // _list_of_movies.Add(movie); //} if (!i.Equals(movie)) { _list_of_movies.Add(movie); } } }
public void add(Movie movie) { bool movieExists = false; if (!movies.Contains(movie)) { foreach (Movie movie1 in movies) { if (movie1.title == movie.title) movieExists = true; } if (!movieExists) movies.Add(movie); } }
public void add(Movie movie) { if (already_contains(movie)) return; movies.Add(movie); }
public IEnumerable<Movie> sort_all_movies_by_movie_studio_and_year_published() { var temp = new Movie[this.movies.Count]; this.movies.CopyTo(temp, 0); for (var i = 0; i < temp.Length; i++) { for (var j = i; j < temp.Length; j++) { if (temp[i].rating < temp[j].rating) { var t = temp[i]; temp[i] = temp[j]; temp[j] = t; } } } for (var i=0; i < this.movies.Count - 1; i++) { for (var j=i+1; j<this.movies.Count; j++) { if (temp[i].rating == temp[j].rating) { if (temp[i].date_published.Year > temp[j].date_published.Year) { var t = temp[i]; temp[i] = temp[j]; temp[j] = t; } } } } return temp; }
public IEnumerable<Movie> sort_all_movies_by_date_published_descending() { var temp = new Movie[this.movies.Count]; this.movies.CopyTo(temp, 0); for (var i = 0; i < temp.Length; i++) { for (var j = i; j < temp.Length; j++) { if (temp[i].date_published < temp[j].date_published) { var t = temp[i]; temp[i] = temp[j]; temp[j] = t; } } } return temp; }
bool already_contains(Movie other_movie) { foreach (var movie in movies) { if (movie.Equals(other_movie)) return true; } return false; }
int get_studio_rating(Movie movie) { var ratings = new List<ProductionStudio>(); ratings.Add(ProductionStudio.mgm); ratings.Add(ProductionStudio.pixar); ratings.Add(ProductionStudio.dreamworks); ratings.Add(ProductionStudio.universal); ratings.Add(ProductionStudio.disney); return ratings.IndexOf(movie.production_studio); }
bool already_contains(Movie other_movie) { return movies.Contains(other_movie); }
public void add(Movie movie) { if (movies.Contains(movie)) return; movies.Add(movie); }
public void add(Movie movie) { throw new NotImplementedException(); }
bool already_contains(Movie movie) { return list_of_movies.Contains(movie); }
bool contains(Movie movie) { if (movies.Contains(movie)) return true; foreach (var movie1 in movies) { if (movie1.title == movie.title) return true; } return false; }
public void add(Movie movie) { if (does_not_contains(movie)) movies.Add(movie); }
bool does_not_contains(Movie movie) { return !contains(movie); }
bool already_contains(Movie movie) { return movies.Contains(movie); }
public bool is_a_kids_movie(Movie movie) { return movie.genre == Genre.kids; }