Skip to content

Instantly share code, notes, and snippets.

@Serchinastico
Created September 14, 2018 14:19
Show Gist options
  • Save Serchinastico/5c2c37c451db4d88a4003dc3ccd56c10 to your computer and use it in GitHub Desktop.
Save Serchinastico/5c2c37c451db4d88a4003dc3ccd56c10 to your computer and use it in GitHub Desktop.
Rocket League exercise
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