I am building a game engine, and I am actually having a very difficult time placing what kind of namespace to put Character
under. This may be the single dumbest question I've ever posted on StackOverflow, but it's driving me nuts.
What would you guys do?
I don't really have any other namespaces yet defined. Characters h开发者_Go百科ave Sheets (Layout), which reference Traits (Statistics), etc. Everything is just kind of dumped into the root namespace right now.
Go with Characters.
It's simple and to the point. You'll end up including lots of classes in it that describe player and non player characters, attributes, abilities, and so on, but they all refer to characters. Your base class for characters will likely be something like Character, so the naming collision is avoided.
And the guideline to avoid plurality in namespaces is just a guideline. There are cases where deviation is warranted (I'm looking at you, System.Windows.Forms).
精彩评论