Add getAttackPower method to pattern decorator may make it more easily to understand .
when the troll not add smart decorator , his attack power is 10 ,but when we build the smartTroll , his attack power is 10(the normal troll's attack power) + 20(because smart). So ,it's more easy to understand .
Add getAttackPower method to pattern decorator may make it more easily to understand .
when the troll not add smart decorator , his attack power is 10 ,but when we build the smartTroll , his attack power is 10(the normal troll's attack power) + 20(because smart). So ,it's more easy to understand .