示例#1
0
 public bool IsSatisfiedBy(Screening screening)
 {
     return
         (screening.GetStartTime().DayOfWeek == m_DayOfWeek &&
          m_StartTime.CompareTo(screening.GetStartTime().ToLocalTime()) <= 0 &&
          m_EndTime.CompareTo(screening.GetStartTime().ToLocalTime()) >= 0);
 }
示例#2
0
        public Money CalculateDiscountAmount(Screening screening)
        {
            if (m_Conditions is null)
            {
                return(Money.Zero);
            }

            foreach (var condition in m_Conditions)
            {
                if (condition.IsSatisfiedBy(screening))
                {
                    return(GetDiscountAmount(screening));
                }
            }

            return(Money.Zero);
        }
示例#3
0
 protected abstract Money GetDiscountAmount(Screening screening);