Skip to content
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 EnumString to separate file and add enum_to_string #15714

Merged
merged 3 commits into from
Jan 26, 2025

Conversation

cx384
Copy link
Contributor

@cx384 cx384 commented Jan 25, 2025

This PR only moves code and adds enum_to_string, so it should be easy to review.
(As mentioned in one of my other PRs #15681)

c_types.h now only contains LuaError and StackUnroller, and includes improved.

(At first, I implemented a very fancy templated enum <-> string conversion handler to do as much as possible at compile time, but the improvement was questionable not really worth the change, so I kept our EnumString.)

Note:
Only es_HudBuiltinElement does not use enum_to_string, since it behaves a little different.

es_ItemType and es_TouchInteractionMode are (currently) only needed in c_content.cpp so I moved them there, IMO it's better than keeping them in c_types.h.

To do

Ready for Review.

How to test

I don't know.

@cx384 cx384 added Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements Code quality labels Jan 25, 2025
src/util/enum_string.cpp Outdated Show resolved Hide resolved
src/util/enum_string.cpp Show resolved Hide resolved
src/util/enum_string.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Co-authored-by: sfan5 <[email protected]>
@sfan5 sfan5 merged commit e9826f7 into luanti-org:master Jan 26, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code quality Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements One approval ✅ ◻️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants