We know the Decorator design pattern, but how would someone go about implementing mutually exclusive decorators?
Let's say I have a decorator pattern to implement weapon modifiers in a game. The decorators would be, for example, "poisonous", "fire-enchanted", "ice-enchanted", etc. Now let's say I don't want my weapon to be both fire and ice-enchanted (just because), how would I go about implementing that logic in my decorator pattern?
Would I need to break it up or pervert it beyond recognition?
My best idea now is to have a
GetDecorations() method on my interface and use it in the new decorator class to ensure that the new decoration won't violate any restrictions. But that seems to go against the Decorator principle of "not knowing" you can be decorated...