Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 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);
         }
     }
 }
Esempio n. 3
0
 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);
     }
 }
Esempio n. 4
0
        public void add(Movie movie)
        {
            if (already_contains(movie)) return;

              movies.Add(movie);
        }
Esempio n. 5
0
        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;
        }
Esempio n. 6
0
        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;
        }
Esempio n. 7
0
        bool already_contains(Movie other_movie)
        {
            foreach (var movie in movies)
            {
                if (movie.Equals(other_movie)) return true;
            }

            return false;
        }
Esempio n. 8
0
        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);
        }
Esempio n. 9
0
 bool already_contains(Movie other_movie)
 {
     return movies.Contains(other_movie);
 }
Esempio n. 10
0
        public void add(Movie movie)
        {
            if (movies.Contains(movie)) return;

            movies.Add(movie);
        }
Esempio n. 11
0
 public void add(Movie movie)
 {
     throw new NotImplementedException();
 }
 bool already_contains(Movie movie)
 {
     return list_of_movies.Contains(movie);
 }
Esempio n. 13
0
        bool contains(Movie movie)
        {
            if (movies.Contains(movie))
                return true;

            foreach (var movie1 in movies)
            {
                if (movie1.title == movie.title)
                    return true;
            }

            return false;
        }
Esempio n. 14
0
 public void add(Movie movie)
 {
     if (does_not_contains(movie))
         movies.Add(movie);
 }
Esempio n. 15
0
 bool does_not_contains(Movie movie)
 {
     return !contains(movie);
 }
Esempio n. 16
0
 bool already_contains(Movie movie)
 {
     return movies.Contains(movie);
 }
Esempio n. 17
0
 public void add(Movie movie)
 {
     throw new NotImplementedException();
 }
Esempio n. 18
0
 public bool is_a_kids_movie(Movie movie)
 {
     return movie.genre == Genre.kids;
 }