Open Sternbach-Software opened 2 years ago
Use KotlinFunctionLibrary.recursiveMap
fun PersonNode.getSurroundingPeople(includeSpouseFamily: Boolean = true) = origin.parents + origin.siblings + origin.children + (if(includeSpouseFamily) listOf(origin.spouse) else listOf()) origin.getSurroundingPeople().recursiveMapNotNull({ it.getSurroundingPeople()) { if(it.matchesConstraint(...)) it else null }
If I'm not mistaken, this will use depth first search starting with the parents.
Use KotlinFunctionLibrary.recursiveMap
If I'm not mistaken, this will use depth first search starting with the parents.