ludic.things: things_reserve sizes the rows, grid, kind index and uid map (tb_reserve, imap_reserve)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 15:59:41 +03:00
parent a3b2da86b5
commit 07a6c35470

View file

@ -50,9 +50,12 @@ function th_clean(t: Thing) -> Thing {
return t
}
# room for `n` Things in the grid before it has to grow: a world that will place more in play
# than it placed at the start sizes it once, at the start
export function things_reserve(things_st: mut ThingsState, n: int) -> void { grid_reserve(things_st.th.grid, n) }
# room for `n` Things (rows, grid, kind index, uid map) before any grows: a world that will place
# more in play than it placed at the start sizes it once, at the start
export function things_reserve(things_st: mut ThingsState, n: int) -> void {
tb_reserve(things_st.th.tab, n)
imap_reserve(things_st.th_uids, n)
}
export function things_spare_count(things_st: ThingsState) -> int { return len(things_st.th_spare) - things_st.th_spare_at }