samedicorp / dualuniverse-feedback

Dual Universe Suggestions and Bugs
0 stars 0 forks source link

Core / Element API Improvements #25

Open samdeane opened 3 years ago

samdeane commented 3 years ago

Cores And Elements

It seems fairly crazy that we can iterate the core to get basic information about the id, type, etc of each element (using getElementIdList(), getElementNameById, ...), but we can't get the actual element objects that way. We have to link them, then access the named variables connected with each link. If we want to iterate all linked elements, we have to build our own table and write manual code to add the elements to it. That doesn't make a lot of sense!

I would suggest deprecating most of the existing API, and just having two element related methods:

All other properties can then be read from the existing element API:

A few element API additions would be good:

In an ideal world, it would be possible to also set position and orientation, to actually reconfigure constructs dynamically. This could result in illegal placements, however, so perhaps would not be a good idea.