Last active
July 17, 2019 21:57
-
-
Save akehoyayoi/a65e4b9f2aaac264eceade8622fa89e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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