Skip to content

Instantly share code, notes, and snippets.

@travisdachi
Last active August 13, 2016 10:17
Show Gist options
  • Save travisdachi/84811ddf2293ae466534b0b2ebde12a9 to your computer and use it in GitHub Desktop.
Save travisdachi/84811ddf2293ae466534b0b2ebde12a9 to your computer and use it in GitHub Desktop.
fun attack(target: Target, weapon: Weapon = Fist(), critical: Float = 0.1F) {
//...
}
// <paramName>: <paramType> [= <defaultValue>]
val target = getCurrentTarget()
attack(target)
attack(target, Sword())
attack(target, Bow(), 0.5F)
attack(target = target, critical = 0.9f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment