clintbellanger/flare-engine — pull request #651 by RyanDansie (2013-05-01 22:54:41+00:00)
Title: Singleton on PowerManager (for review)

This is an implementation of https://github.com/clintbellanger/flare-engine/issues/621 for the PowerManager class. Basically it slightly simplifies the way that other classes access the PowerManager class by removing the need to store local references to the class instance and passing duplicate data around between the classes.

This is applicable for all classes for which there will only be one instance e.g. Avatar, EnemyManager etc but I'm just showing it here for PowerManager so that it can be reviewed. If its found to be agreeable, it would be implemented for all of those other classes as well. I would estimate about 200 lines of code removed as a result, with an ongoing benefit for future development.

My only critique of the code is that "PowerManager::instance" is more long winded to type than "powers", but perhaps there's a way to shorten it.

Thoughts?