MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / update

Method update

src/main/java/trace/simulation/Boids.kt:16–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14 var important = mutableSetOf<Boid>()
15
16 fun update(scale: Double) {
17 val next = mutableListOf<Boid>()
18
19 ArrayList(all).forEach {
20
21 val n = propagate(it, all, scale)
22 if (n != null) {
23 next.add(n)
24 }
25 }
26
27 all = next
28 important.clear()
29
30 }
31
32 fun addBoid(at: Vec2, heading: Vec2) {
33 all.add(Boid(at, heading.safeNormalize()))

Callers

nothing calls this directly

Calls 4

propagateFunction · 0.50
forEachMethod · 0.45
addMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected