Exemplo n.º 1
0
 public Movie(string title, MoviePerson director, int year, int rotTomScore, decimal imdbScore, List <string> actors)
 {
     Title       = title;
     Director    = director;
     Year        = year;
     RotTomScore = rotTomScore;
     ImdbScore   = imdbScore;
     Actors      = actors;
 }
Exemplo n.º 2
0
        public override bool Equals(object obj)
        {
            MoviePerson other = obj as MoviePerson;

            if (other == null)
            {
                throw new ArgumentException("Argument of Equals must be of type MoviePerson");
            }
            return(FirstName.Equals(other.FirstName) &&
                   LastName.Equals(other.LastName) &&
                   BirthDate.Equals(other.BirthDate));
        }
Exemplo n.º 3
0
        public int CompareTo(object obj)
        {
            MoviePerson a = obj as MoviePerson;

            if (a == null)
            {
                throw new ArgumentException("CompareTo must get argument of type MoviePerson");
            }
            else
            {
                int compare = lastName.CompareTo(a.lastName);
                if (compare == 0)
                {
                    return(firstName.CompareTo(a.firstName));
                }
                return(compare);
            }
        }