Factory.create(): allow any name/values for initialization

Hello,

I would like to suggest a better way to initialize game objects when creating them with factory.create(). Currently, I find it unnecessarily cumbersome to get the right values to the game object’s init() method.

I would be happy to get any comments on this feature request:

Thanks,
Lutz

5 Likes

Great suggestion, I’ve thought of the same thing a few times but never posted about it. +1

2 Likes

Mixing non-properties and properties is not the best idea :thinking:

If we would go down this road, perhaps it is better to separate them - the implementation I imagine might be then way easier too - add another parameter to create() - a table with non-properties, some user data

I agree with you. We have for good reasons not added support for complex and arbitrary sized data. I’ve added a comment to the feature request.

1 Like

Thanks for your comment, @britzl. However, I think your suggestion does not work (or I am missing something fundamental).

I have explained the problem as I see it in the Github issue - I would be happy to read your opinion.

Thanks,
Lutz

1 Like