What benefit does that offer over reflection, though? The reflection method is already roughly three lines of code and didn’t require me to define a dictionary.
I understand there’s a performance hit, but reflection is used a single time per runthrough of the application, taking 100-200 times as long as a simple assignment is not even remotely an issue.
see my original comment about "over-engineering". In our application we generally avoid any code that depends on the results of reflection to get to a certain block because we would consider it less reliable in the face of name changes and other modifications, but those may be concerns that are irrelevant to a project of your scope and size.
Ah, that makes sense; yeah, it’s definitely less resilient to the case of ‘a function’s name changes’, and that makes a lot of sense in the context of a major team-written application.
The functions I’m finding with it are manual-algorithmically named (it’s always MonsternameEncounter), so in any case where reflection would fail to find it, it would be a breach of the style guide. (Not that I actually wrote a style guide since I’m the only one working on it, but you get the idea :P)