PistonDevelopers / editor

Editor interface
MIT License
4 stars 1 forks source link

References #8

Open bvssvni opened 9 years ago

bvssvni commented 9 years ago

It is desirable to keep data structures as close to normal Rust as possible. Therefore, it is assumed that a reference table must be built. This can be done by traversing the whole structure or indexed lists and put it in a Vec<Reference>. Alternative is to put references in a hash map using to-object as key.

The reference table can be sorted by different criteria by need. If an action is looking for references pointing to an object, it can sort the table by to_type, to in memory.

bvssvni commented 9 years ago

Maybe Reference should have an optional field that lets you decide whether a reference can be deleted without deleting the object itself.

bvssvni commented 9 years ago

There is a problem when you have a property widget and a field with an optional reference. The fields of an object will not return null references.