Example #1
0
        public override bool Equals(object obj)
        {
            if (obj is TimeTable)
            {
                TimeTable comparedTimeTable = (TimeTable)obj;

                foreach (var movieByTime in MoviesByTime)
                {
                    if (!movieByTime.Value.Equals(comparedTimeTable.MoviesByTime[movieByTime.Key]))
                    {
                        return(false);
                    }
                }

                return(TimeLeft == comparedTimeTable.TimeLeft);
            }
            else
            {
                return(false);
            }
        }
 public TimeTableCreator(IEnumerable <Movie> movies, WorkDay workDay)
 {
     Movies        = movies;
     WorkDay       = workDay;
     BestTimeTable = new TimeTable(WorkDay.TimeLeft);
 }