Ever wanted to do:
var awesomeNewHat = new OfProgramming( new Sagacious( new WizardHat() ) ); awesomeNewHat.Use();
Well, I used to, that’s why I implemented an affix system with the decorator pattern. Code available here – https://github.com/abeldantas/item-affix-decorators
> Puts on Sagacious Wizard Hat of Programming
An affix system is the sort of thing every loot based RPG needs to have satisfying item names and effects.
Here, have some hats:
The decorator pattern can model a lot of fun stuff in games.
Making a skill system should be fun too, where the decorating order factors into what effects you get.