feat(base): 0.R4 - a queue keeps its own count, so every package verb takes only its own state; ludic migrate state --prune
ludic.base's Queue<T> carries a QueueTag (its name and pending count): queue_new(name), q_push(q, v), q_drain(q), q_clear(q) take no BaseState, and core_undrained(tags) names the given queues still holding facts. A reducer on a package's state can now call that package's verbs (wallet_earn(wallet_st, n)). ludic migrate state --prune (ludicc --migrate-prune) takes out each state parameter a function no longer uses, nor anything it calls, and the argument that fills it - including an argument for a parameter the callee has dropped, which is taken out before the call is checked, so a generic's T is told by the argument that says it. A reducer keeps its state. --dry-run now counts the edits it would make. Every package was moved with it: 608 base_st parameters and their arguments, 1889 edits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8cf4b3fed6
commit
71735b10a2
151 changed files with 58668 additions and 54719 deletions
|
|
@ -13,7 +13,7 @@ export state NpcTestsFakeState {
|
|||
fk_gone: int = 0
|
||||
}
|
||||
|
||||
function fk_setup(base_st: mut BaseState, npc_st: mut NpcState, npc_tests_fake_st: mut NpcTestsFakeState) -> void {
|
||||
function fk_setup(npc_st: mut NpcState, npc_tests_fake_st: mut NpcTestsFakeState) -> void {
|
||||
npc_tests_fake_st.fk_hour = 12.0
|
||||
npc_tests_fake_st.fk_day = 1
|
||||
npc_tests_fake_st.fk_want = 0
|
||||
|
|
@ -24,7 +24,7 @@ function fk_setup(base_st: mut BaseState, npc_st: mut NpcState, npc_tests_fake_s
|
|||
npc_tests_fake_st.fk_born = 0
|
||||
npc_tests_fake_st.fk_gone = 0
|
||||
npc_clear(npc_st)
|
||||
npc_reset(base_st, npc_st)
|
||||
npc_reset(npc_st)
|
||||
npc_seed(npc_st, 7)
|
||||
npc_config(npc_st, 10)
|
||||
}
|
||||
|
|
@ -53,10 +53,10 @@ function fk_player_at(npc_tests_fake_st: mut NpcTestsFakeState, x: float, z: flo
|
|||
}
|
||||
|
||||
# seconds of the place, in twentieths
|
||||
function fk_run(base_st: mut BaseState, npc_st: mut NpcState, secs: float) -> void { for k in 0 .. int(secs * 20.0) { npc_tick(base_st, npc_st, 0.05) } }
|
||||
function fk_run(npc_st: mut NpcState, secs: float) -> void { for k in 0 .. int(secs * 20.0) { npc_tick(npc_st, 0.05) } }
|
||||
|
||||
function fk_count(base_st: mut BaseState, npc_st: mut NpcState, what: int) -> int {
|
||||
let fs = q_drain(base_st, npc_facts(base_st, npc_st))
|
||||
function fk_count(npc_st: mut NpcState, what: int) -> int {
|
||||
let fs = q_drain(npc_facts(npc_st))
|
||||
var n = 0
|
||||
for i in 0 .. len(fs) { if fs[i].what == what { n += 1 } }
|
||||
return n
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue