Skip to content

Instantly share code, notes, and snippets.

@Nimrodda
Created June 6, 2019 07:25
Show Gist options
  • Save Nimrodda/a71780eab8194b7d6cbb2cb2e959a963 to your computer and use it in GitHub Desktop.
Save Nimrodda/a71780eab8194b7d6cbb2cb2e959a963 to your computer and use it in GitHub Desktop.
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