Revolutionary-Games/Thrive — pull request #48 by jjonj (2013-10-21 18:46:08+00:00)
Title: Agent registry

I created the AgentRegistry in c++.
Things to note/comment on:
- I created the class in agent.h/.cpp
- The interface contains the requested registerAgentType(internalName, displayName) and three other methods.
- The class is static by design as this was the most elegant solution to me (controversial), if a singleton (for lazy initialization and homogeneity) or more purist OOP design is desired, i will oblige.
- The class is a little more complex than it perhaps needed to be, as i implemented a reverse map for O(1) lookup on internal name. It can be simplified a fair amount if O(n) is a desired tradeoff for such.
- I contemplated doing unit-tests for the class but the static nature and relative simplicity did not permit/necessitate it. Could be an argument for a different pattern. HOWEVER i did test the class thoroughly.