예제 #1
0
 public Reservation(Customer customer, Screening screening, Money fee, int audienceCount)
 {
     this.customer      = customer;
     this.screening     = screening;
     this.fee           = fee;
     this.audienceCount = audienceCount;
 }
예제 #2
0
        public Money CalculateDiscountAmount(Screening screening)
        {
            foreach (var each in conditions)
            {
                if (each.IsSatisfiedBy(screening))
                {
                    return(getDiscountAmount(screening));
                }
            }

            return(screening.MovieFee);
        }
예제 #3
0
 public Money calculateMovieFee(Screening screening)
 {
     return(Fee - discountPolicy.CalculateDiscountAmount(screening));
 }
예제 #4
0
 protected override Money getDiscountAmount(Screening screening)
 {
     return(new Money(0));
 }
예제 #5
0
 protected override Money getDiscountAmount(Screening screening)
 {
     return(screening.MovieFee * percent);
 }
예제 #6
0
 protected override Money getDiscountAmount(Screening screening)
 {
     return(discountAmount);
 }
예제 #7
0
 abstract protected Money getDiscountAmount(Screening screening);
예제 #8
0
 public bool IsSatisfiedBy(Screening screening)
 {
     return(screening.StartTime.DayOfWeek.Equals(dayOfWeek) &&
            startTime <= screening.StartTime.TimeOfDay &&
            endTime >= screening.StartTime.TimeOfDay);
 }
예제 #9
0
 public bool IsSatisfiedBy(Screening screening)
 {
     return(screening.IsSequence(sequence));
 }