clintbellanger/flare — pull request #610 by stefanbeller (2012-07-16 19:55:38+00:00)
Title: [Discussion] Minimap should be updated on events.

As discussed in the notes of #604 the mini map should only be rendered when necessary, that is on map change and on events.

The rendering on map changes is done and works.
The question that remains is about the events. How would you notify the MenuMiniMap class to re-render the mini map?
The MapRenderer class knows when a map-changing event happens, but doesn't know the mini map,
so how would you route the information through the classes?

Of course we could put yet another class variable with pointer to the menu mini map class, but I wouldn't really like it.

Another solution would be to introduce a static getInstance() method at the mini map class, but then that class also is able to be setup just once. (Do we plan to have multiple mini maps later on?)

Or the Gamestateplay class could take care of routing the information to the minimap as it already does when changing the map. That would mean introducing a boolean variable on the maprenderer class, which tells the gamestateplay if there was an event changing the map, so the gamestateplay can check that variable each frame and sync up the mini map.

Other ideas?