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:
@@ -121,6 +121,7 @@ func (obj *wrappedGrouper) VertexMerge(v1, v2 pgraph.Vertex) (v pgraph.Vertex, e
|
||||
if err = r1.GroupRes(r2); err != nil { // GroupRes skips stupid groupings
|
||||
return // return early on error
|
||||
}
|
||||
r2.SetParent(r1) // store who my parent is
|
||||
|
||||
// merging two resources into one should yield the sum of their semas
|
||||
if semas := r2.MetaParams().Sema; len(semas) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user