Created
June 6, 2019 07:25
-
-
Save Nimrodda/a71780eab8194b7d6cbb2cb2e959a963 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
private val globalId = AtomicInteger(1) | |
typealias OnGenreExpanded = (genre: Genre) -> Unit | |
data class Container( | |
val genres: List<GamesPerGenre>, | |
val onGenreExpanded: OnGenreExpanded | |
) | |
data class GamesPerGenre( | |
val genre: Genre, | |
val games: List<Game> | |
) | |
data class Genre( | |
val name: String, | |
val isExpanded: Boolean = false, | |
val id: Int = globalId.getAndIncrement() | |
) | |
data class Game( | |
val name: String, | |
val id: Int = globalId.getAndIncrement() | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment