hypar-io / Elements

The smallest useful BIM.
https://www.hypar.io
MIT License
349 stars 74 forks source link

SharedObject concept #1023

Closed katehryhorenko closed 3 days ago

katehryhorenko commented 1 year ago

BACKGROUND: It's a part of the PRs that will help to introduce multiple representations concept.

DESCRIPTION: SharedObject - is object with id.
During deserialization SharetdObject has the same behavior as Element. If Element has SharedObject property, it will be replaced with GUID and shared object will be saved inside Model.SharedObjects list, So now we have two lists: Elements and SharedObjects.

SharedObject can be deserialized after Element, so I added WaitList that keep track of giuds that were not replaced with deserialized objects. Once element is deserialized, it will replace the pending guid.

TESTING: I tested it with multiple representations, but it can be tested by adding shared object to the Element.

REQUIRED:


This change is Reviewable