Created
September 14, 2018 14:19
-
-
Save Serchinastico/5c2c37c451db4d88a4003dc3ccd56c10 to your computer and use it in GitHub Desktop.
Rocket League exercise
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
sealed class Vinyl { | |
object Skull : Vinyl() | |
data class Angels(val numberOfAngels: Int) : Vinyl() | |
data class Flowers(val numberOfFlowers: Int) : Vinyl() | |
data class Guns(val label: String) : Vinyl() | |
object Boots : Vinyl() | |
} | |
typealias Flag = Color | |
data class Wheel( | |
val sizeInInches: Float, | |
val tyre: Tyre | |
) { | |
enum class Tyre { | |
Ultrasoft, Supersoft, Soft, Medium, Hard, Intermediate, Wet | |
} | |
} | |
data class Car( | |
val vinyl: Vinyl, | |
val flag: Flag?, | |
val wheel: Wheel | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment