forEach

inline fun <E : Node> GroupEntity<E>.forEach(action: (E) -> Unit)

Runs action on each child, in draw order.

The group iterates directly — it is deliberately not Iterable, so the stdlib collection extensions do not attach; GroupEntity.children is the surface for everything beyond iteration. The children visited are this value's own immutable list, so rebinding a var holding this group from inside action never disturbs the iteration. An exception thrown by action propagates unchanged.

Receiver

The entity whose children to visit.

Parameters

action

The function to run on each child.

Type Parameters

E

The children's type.