refering to the getter.
Are properties prohibited in mixins, or is this a mistake?
- Code: Select all
mixin ManageAttitude
var _attitude as decimal
get attitude from _attitude
def happierBy(n as decimal)
require
n >= 0.0 and n<=1.0
body
_attitude = Math.min(1.0, .attitude + n) # atmost
def sadderBy(n as decimal)
require
n >= 0.0 and n<=1.0
body
_attitude = Math.max(0.0, .attitude - n) # atleast
Thanks, kobi