wip(0.S3): packages and examples migrated again from their pre-0.S sources in one run
ludic migrate state packages <every example program> packages/ludic.lab/example/plate.ludic 1804 vars into 126 states, 64 into lets; 23498 edits in 460 files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5ffe50ed02
commit
19fcf60599
459 changed files with 17862 additions and 17603 deletions
|
|
@ -3,19 +3,21 @@
|
|||
import "ludic.base"
|
||||
program RegistryTest {
|
||||
numbers float
|
||||
var trail: string = ""
|
||||
function late_tick(t: Tick) -> void { trail = trail + "l" }
|
||||
function early_tick(t: Tick) -> void { trail = trail + "e" }
|
||||
function added_tick(t: Tick) -> void { trail = trail + "a" }
|
||||
state RegistryTestState {
|
||||
trail: string = ""
|
||||
}
|
||||
function late_tick(registry_test_st: mut RegistryTestState, t: Tick) -> void { registry_test_st.trail = registry_test_st.trail + "l" }
|
||||
function early_tick(registry_test_st: mut RegistryTestState, t: Tick) -> void { registry_test_st.trail = registry_test_st.trail + "e" }
|
||||
function added_tick(registry_test_st: mut RegistryTestState, t: Tick) -> void { registry_test_st.trail = registry_test_st.trail + "a" }
|
||||
def Systems late { phase: PH_RESOLVE, tick: fn late_tick }
|
||||
def Systems early { phase: PH_INPUT, tick: fn early_tick }
|
||||
test "the declared systems run, phase by phase" {
|
||||
expect_eq(core_count(), 2)
|
||||
test "the declared systems run, phase by phase" (base_st: mut BaseState, registry_test_st: RegistryTestState) {
|
||||
expect_eq(core_count(base_st), 2)
|
||||
expect(Systems[SYS_LATE].key == "late")
|
||||
let s = system_new("added", PH_INPUT)
|
||||
s.tick = fn added_tick
|
||||
core_add(s)
|
||||
core_tick_all(tick_new(0.016, 1, 0.0))
|
||||
expect(trail == "eal")
|
||||
core_add(base_st, s)
|
||||
core_tick_all(base_st, tick_new(0.016, 1, 0.0))
|
||||
expect(registry_test_st.trail == "eal")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue