jeudi 26 novembre 2015

observer pattern with decorator pattern

I am trying to implement a game log observer that that shows dynamically selected actions taken in selected players/phases of a game. I am also trying to implement a decorator pattern to enable dynamic toggling of logging for each player's action or game phase.

For example, I can select to view logs for only 1 player or all players. Or just one phase or all phases (risk game: reinforce, attack, fortification phases).

This is where I am stuck. I have no idea where to start. I understand the decorator pattern and the observer somewhat but don't know how to implement this. The way I figured it was that the decorator pattern allows you to make the choices/actions you want and its "results" are added to the observer. Is that right? Any ideas to point me in the right direction would be appreciated!

Aucun commentaire:

Enregistrer un commentaire