public Ticket(UIClass seatClass, UIDiscount discount, UIWay way, string from, string to) { this.seatClass = ClassAssigner.GetClass(seatClass); this.discount = DiscountAssigner.GetDiscount(discount); this.way = way; this.from = from; this.to = to; }
//Chooses the correct Seatclass public static SeatClass GetClass(UIClass info) { SeatClass seatclass = null; switch (info) { case UIClass.FirstClass: seatclass = new FirstClass(); break; case UIClass.SecondClass: seatclass = new SecondClass(); break; } return(seatclass); }