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
|
|
@ -1,7 +1,7 @@
|
|||
# check.ludic - once a frame on the machine that owns the story: every open step of the current
|
||||
# chapter that is met now sticks (STEPS_MET), and a chapter with all of them done moves the arc on
|
||||
# (STEPS_CHAPTER). A step asks about STATE, so one met before its chapter opened ticks at once.
|
||||
export function steps_check(base_st: mut BaseState, steps_st: mut StepsState) -> void {
|
||||
export function steps_check(steps_st: mut StepsState) -> void {
|
||||
if steps_finished(steps_st) { return }
|
||||
let ch = steps_st.steps__cur
|
||||
let n = steps_in(steps_st, ch)
|
||||
|
|
@ -9,14 +9,14 @@ export function steps_check(base_st: mut BaseState, steps_st: mut StepsState) ->
|
|||
for i in 0 .. n {
|
||||
if not steps_done(steps_st, i) and steps_met(steps_st, i) {
|
||||
steps_st.steps__done = steps_st.steps__done | (1 << i)
|
||||
steps__fact(base_st, steps_st, STEPS_MET, ch, i)
|
||||
steps__fact(steps_st, STEPS_MET, ch, i)
|
||||
}
|
||||
if not steps_done(steps_st, i) { all = false }
|
||||
}
|
||||
if not all { return }
|
||||
steps_st.steps__cur = ch + 1
|
||||
steps_st.steps__done = 0
|
||||
steps__fact(base_st, steps_st, STEPS_CHAPTER, ch, n)
|
||||
steps__fact(steps_st, STEPS_CHAPTER, ch, n)
|
||||
}
|
||||
|
||||
# is step i of chapter ch met by this machine's own state? (a chapter not being played, a panel)
|
||||
|
|
@ -36,8 +36,8 @@ export function steps_wants(steps_st: StepsState, kind: int, param: int) -> bool
|
|||
}
|
||||
|
||||
# back to no arc and no party (tests)
|
||||
export function steps_reset(base_st: mut BaseState, steps_st: mut StepsState) -> void {
|
||||
export function steps_reset(steps_st: mut StepsState) -> void {
|
||||
steps_arc_clear(steps_st)
|
||||
steps__party_clear(steps_st)
|
||||
q_clear(base_st, steps_facts(base_st, steps_st))
|
||||
q_clear(steps_facts(steps_st))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue