Last active
February 7, 2018 01:14
-
-
Save ahinchman1/3986bb0220b7ef6cf8e46208e0b75d5b to your computer and use it in GitHub Desktop.
Naming conventions, descriptive vs oversimplified
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
private fun drop(evt : MouseEvent) { | |
val mousePt = workArea.sceneToLocal( evt.sceneX, evt.sceneY ) | |
val targetNode = evt.target as Node | |
val tileTarget = targetNode.findParentOfType(Tile::class) | |
if (::inFlightTileProperties.isInitialized && isDragAndDrop) { | |
if (tileTarget is Tile && workArea.contains(mousePt) && | |
inFlightTileProperties.title.toIntOrNull() == null) { | |
// find the grid tile the dragging tile drops on | |
pickGridTile(mousePt.x, mousePt.y) | |
root.children[1].getChildList()!!.remove(inFlightTile) | |
inFlightTileProperties.width = 100.0 | |
inFlightTileProperties.height = 100.0 | |
isDragAndDrop = false | |
} | |
} | |
e.consume() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment