Last active
May 28, 2019 19:29
-
-
Save scottashipp/aea21a378575b59adab4 to your computer and use it in GitHub Desktop.
Example trait for stackable traits explanation at https://code.scottshipp.com/?p=1368
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
trait FivePercentBonus extends BuckooBucks { | |
abstract override def addBucks(amt: Int) = { | |
if(amt >= 500) { | |
val bonus = (0.05 * amt) | |
buckooBalance += amt | |
} | |
super.addBucks(amt) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment