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

Method update

src/main/java/fieldkotlin/Phases.kt:54–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52 update(end)
53 }
54 1 -> {
55 if (end) {
56 status = 2
57 }
58 val c = children[Phases.cont]
59 if (c != null) c()
60 if (end) {
61 update(end)
62 }
63 }
64 2 -> {
65 status = 3
66 val c = children[Phases.cont]
67 if (c != null) {
68 c()
69 }
70 }
71 3 -> {
72
73 }
74 }
75 return status != 3
76 } catch (e: EndNow) {
77 status = 3
78 return false
79 }
80 }
81
82
83 fun begin(init: () -> Unit) = initPhase(Phases.begin, init)
84
85 fun cont(init: () -> Unit) = initPhase(Phases.cont, init)
86
87 fun end(init: () -> Unit) = initPhase(Phases.end, init)
88
89
90}
91
92
93fun phases(init: PhaseList.() -> Unit): PhaseList {
94 val phases = PhaseList()
95 phases.init()
96 return phases
97}
98
99fun frame(m: () -> Unit): PhaseList {
100 return phases {
101 cont {
102 m()
103 }
104 }
105}
106
107
108fun frames(m: suspend SequenceScope<Any>.() -> Unit): PhaseList {
109 return phases {
110 val s = sequence<Any>(m)
111 lateinit var i: Iterator<Any>

Callers

nothing calls this directly

Calls 3

cFunction · 0.50
updateFunction · 0.50
forEachMethod · 0.45

Tested by

no test coverage detected