New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move STR_NONE, STR_EMPTY to StringIdType.h #22019
Conversation
I don't like common.h generally speaking, doing a common header violates almost always the rule of include what you need. I would rather have it StringId.h (the type and defaults like invalid) and StringIds.h (the collection/base ids) |
Hmm, yes, I was also thinking it would be better to split it into a header for the Money types. I think Though tbh, it'll create quite the ripple effect, having to re-evaluate inclusion of |
4f3670c
to
44c1d53
Compare
Well for the time being you could just add the StringId.h include in common.h, I don't know about the plural form of StringTypes.h, we just got StringId at the moment, if one includes the wrong header one will figure that out soon enough. My primary concern is that defining types in common.h makes code exploration quite difficult, if someone looks for a string type its somewhat expected to have that in the file name. |
I wouldn't mind including the new header in common.h for the moment, but I'd really like to avoid having a StringId.h for the type and StringIds.h for the enum. With StringTypes.h, I was thinking we could move some types from String.hpp in there as well. I suppose that's a different kind of string types, though. Maybe we could bring this to a vote: |
44c1d53
to
5cfa940
Compare
The votes for |
5cfa940
to
a44e229
Compare
a44e229
to
fc49500
Compare
This entirely removes the need for StringIds.h from a few often-used headers, notably GameActionResult.h and ResultWithMessage.h.
I suggest we rename STR_NONE to something like kStringIdNone in another PR. We can discuss the new name first.