engine: autogroup, traits, graph: Extend autogroup API
This extends the autogrouping API so that a child can easily get a reference to the parent that it is autogrouped in. This can simplify the API for some resources when it makes sense to allow them access to the parent handle. Use sparingly and intelligently!
This commit is contained in:
@@ -93,6 +93,7 @@ func ResCopy(r CopyableRes) (CopyableRes, error) {
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("resource wasn't groupable")
|
||||
}
|
||||
g2.SetParent(dst) // store who my parent is
|
||||
grouped = append(grouped, g2)
|
||||
}
|
||||
dst.SetGroup(grouped)
|
||||
|
||||
Reference in New Issue
Block a user