SceneGate / Yarhl

Framework for the implementation of format converters like game assets or media files
https://scenegate.github.io/Yarhl/
MIT License
59 stars 10 forks source link

Merge nodes #130

Closed Kaplas80 closed 4 years ago

Kaplas80 commented 4 years ago

Description

Implements the option to merge tree nodes instead of replacing them. If we try to add a node with the same name than an existing one and the parameter is set to false, the method will merge their children and tags.

The default value is to keep the current behavior and replace nodes when they have the same name.

Example

node1.Add(node2.Children, false);
Kaplas80 commented 4 years ago

Should I modify the existing MoveChildrenTo in NodeContainerFormat and add an option to merge the children? I'm not sure if creating a new method called MoveMergingChildrenTo would be clearer for the user.