Skip to content

Instantly share code, notes, and snippets.

@10537
Created August 2, 2017 21:37
Show Gist options
  • Save 10537/4bdfbc400cee1f2ce4bd6d8fc0c9bb50 to your computer and use it in GitHub Desktop.
Save 10537/4bdfbc400cee1f2ce4bd6d8fc0c9bb50 to your computer and use it in GitHub Desktop.
Become a Kotlin Programmer Part 6 - Refined Class
class Human(val name: String, val color: String,
val height: Float, var age: Integer): Character() {
var head_armor = false
var body_armor = false
var boots_armor = false
var weapon = false
fun Walk(){
println("Walking...")
}
fun Run(){
println("Running...")
}
fun Talk(){
println("Hello, I'm $name")
}
fun Eat(){
println("I've eaten a fruit")
}
fun Learn(theme: String) {
println("I've learned $theme")
}
fun set_head_armor(){
head_armor = true
}
fun set_body_armor(){
body_armor = true
}
fun set_boots_armor(){
boots_armor = true
}
fun set_weapon(){
weapon = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment