ludic.base: a queue's fact records come round again (q_rec / q_ring_add), used by effects, clock, wallet, weather, tracks, needs, fire, settings, update, steps, crafting, shop, gear, hints, session and photo instead of a new record per fact; the minimap's marks cleared and rubbed out in place, its scale steps without a list; the clock's dice seeded again, not made again; once-per-join, per-save and pool-miss paths declared
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5be2422c84
commit
d9612ba2a6
31 changed files with 215 additions and 25 deletions
|
|
@ -134,6 +134,32 @@ program QueueTest {
|
|||
test "a queue holds records" () { record_case() }
|
||||
test "clear drops what is waiting" () { clear_case() }
|
||||
test "a pool's records are free once no drain holds them" () { unheld_case() }
|
||||
function rec_of(q: Queue<Caught>) -> Caught {
|
||||
var c = q_rec(q)
|
||||
if c == null {
|
||||
c = new Caught
|
||||
q_ring_add(q, c)
|
||||
}
|
||||
return c
|
||||
}
|
||||
function ring_case() -> void {
|
||||
let q: Queue<Caught> = queue_new("caught")
|
||||
let a = rec_of(q)
|
||||
q_push(q, a)
|
||||
let b = rec_of(q)
|
||||
expect(a != b)
|
||||
q_push(q, b)
|
||||
q_drain(q)
|
||||
expect_eq(len(q.ring), 2)
|
||||
let c = rec_of(q)
|
||||
expect(c != a and c != b)
|
||||
q_push(q, c)
|
||||
q_drain(q)
|
||||
let d = rec_of(q)
|
||||
expect(d == a or d == b)
|
||||
expect_eq(len(q.ring), 3)
|
||||
}
|
||||
test "a fact's record comes round again once no list holds it" () { ring_case() }
|
||||
test "a queue's element type is told by the queue alone" () { infer_case() }
|
||||
test "the undrained queues are named, and a drain clears the report" () { undrained_case() }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue