feat(ludic.base): Systems is an open registry - def a system from any module
The runner's list starts from the declared systems, in the order the compiler gives an open registry, and core_add appends after them. registry_test covers it; the README says ludic test runs the package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
73129b59d5
commit
cac8c740fa
3 changed files with 43 additions and 12 deletions
|
|
@ -12,10 +12,17 @@ export property System {
|
|||
load: fn(Val, int) -> void = null
|
||||
}
|
||||
|
||||
# the declared list: a mechanic or the game writes `def Systems fishing { phase: PH_ACT, tick: fn
|
||||
# fishing_tick }` from its own module; the runner starts from these, then core_add appends
|
||||
export open registry Systems of System as SYS
|
||||
|
||||
var cs_list: []System = null
|
||||
|
||||
function cs_all() -> []System {
|
||||
if cs_list == null { cs_list = new []System }
|
||||
if cs_list == null {
|
||||
cs_list = new []System
|
||||
for i in 0 .. SYS_COUNT { push(cs_list, Systems[i]) }
|
||||
}
|
||||
return cs_list
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue