feature/root #69

Merged
altavir merged 23 commits from feature/root into dev 2021-09-11 19:14:21 +03:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit 42eb0a6f66 - Show all commits

View File

@ -215,7 +215,7 @@ private class GdmlLoader(val settings: GdmlLoaderOptions) {
val first: GdmlSolid = solid.first.resolve(root) ?: error("")
val second: GdmlSolid = solid.second.resolve(root) ?: error("")
val type: CompositeType = when (solid) {
is GdmlUnion -> CompositeType.GROUP // dumb sum for better performance
is GdmlUnion -> CompositeType.UNION // dumb sum for better performance
is GdmlSubtraction -> CompositeType.SUBTRACT
is GdmlIntersection -> CompositeType.INTERSECT
}

View File

@ -32,7 +32,9 @@ public inline fun VisionContainerBuilder<Solid>.composite(
): Composite {
val group = SolidGroup().apply(builder)
val children = group.children.values.filterIsInstance<Solid>()
if (children.size != 2) error("Composite requires exactly two children, but found ${children.size}")
if (children.size != 2){
error("Composite requires exactly two children, but found ${children.size}")
}
val res = Composite(type, children[0], children[1])
res.meta.update(group.meta)