Open ppazos opened 8 years ago
Add a function that traverses two archetype trees for the same archetype id referenced by two different templates, and creates a new tree with the union of the nodes (merge).
This might need to implement the item_at_path function in ObjectNode
Also might need to implement clone(), so one tree can be cloned completely, and when traversing the other tree, nodes can be added if those don't exist on the cloned tree, and return the cloned tree plus the added nodes as the merge. This process can be repeated to merge N trees, just cloning the first one and traversing the rest N-1 trees, and calling an insert function like "insert_at_path" if not "node_at_path" exists.
OPTs can use the same archetype but different internal nodes on those archetypes.
But now we are saving the references to the archetypes in one variable instead of saving all the references or merging all the references into one structure. That leads to errors when an existing path is used to get a node from an archetype, and the saved reference on the OptManager doesn't have that node.