Skip to content

Commit

Permalink
refactor: removed redundant onClick() since kotlin now properly reads…
Browse files Browse the repository at this point in the history
… Consumer<>, closes #1188
  • Loading branch information
AlmasB committed Jul 22, 2022
1 parent 804e331 commit d20ed6b
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions fxgl/src/main/kotlin/com/almasb/fxgl/dsl/EntityBuilder.kt
Expand Up @@ -180,10 +180,6 @@ class EntityBuilder {
entity.zIndex = z
}

fun onClick(action: (Entity) -> Unit) = this.also {
onClick(Consumer(action))
}

fun onClick(action: Consumer<Entity>) = this.also {
entity.viewComponent.addEventHandler(MouseEvent.MOUSE_CLICKED, EventHandler { action.accept(entity) })
}
Expand Down

0 comments on commit d20ed6b

Please sign in to comment.