Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// under construction ...
sealed trait BusinessDaySpec
case object WorkDay extends BusinessDaySpec
case object Holiday extends BusinessDaySpec
sealed trait MovieDaySpec
case object MovieDay extends MovieDaySpec
sealed trait TimeSpec
case object NormalTime extends TimeSpec
case object LateshowTime extends TimeSpec
sealed trait HaveSpec
case object HaveCinemaCitizen extends HaveSpec
case object HaveID extends HaveSpec
case object HaveStudentLicense extends HaveSpec
case object HaveStudentNote extends HaveSpec
case object HaveHandicapped extends HaveSpec
case object HaveMIcard extends HaveSpec
case object HaveParking extends HaveSpec
case class Customer(has: HaveSpec)
case class TicketFee(customer: Customer,
businessDaySpec: BusinessDaySpec,
timeSpec: TimeSpec,
movieDaySpec: Option[MovieDaySpec],
fee: Int)
val a = TicketFee(
customer = Customer(has = HaveCinemaCitizen),
businessDaySpec = WorkDay,
timeSpec = NormalTime,
movieDaySpec = None,
fee = 1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.