Skip to content
Discussion options

You must be logged in to vote

You can use a reflection system (i.e. meta in EnTT) and load objects from JSON directly, without many ifs or the like.
You use the item name in the JSON to construct the right component by means of its meta type. Then you iterate the members for that object and pass the values to the meta members.
It requires some glue code, but it's much better, flexible and transparent than what you have right now. 👍

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Mrpaoo
Comment options

Answer selected by Mrpaoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
discussion it sounds interesting, let's discuss it solved available upstream or in a branch
2 participants