TBH: I've never used an observer pattern. But it looks pretty useful for this situation:
I'm developing a very simple strategy game. It involves two combatants who simultaneously bludgeon each other over a short period of time, the winner being the combatant with the most health remaining in the end.
Now, there's a lot of configurable strategies for the combatants, different pieces of equipment that can change how often they attack, etc. I'm also planning on including some "outside" factors like weather that will affect the combatants.
So.... I could create a Fight object that is the subject. It keeps track of the time and notifies the observers every "tick" of the clock.
The observers are two instances of a Combatant object and one Weather object.
It seems like a good idea, but where are the pitfalls? Actually, as I'm typing this I think one problem is that observers are probably ignorant of each others' parameters. Or must they be?
Has anyone used an effective design pattern to do something like this?