refactor(packages): 0.R5 - jobs, session, settings, hints and net make their tables when the state is made, not on the first question (jobs__ensure, session__init and ply_init, sg_init, hn_mute_ensure, net__init gone); their questions read

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-27 01:29:32 +03:00
parent 63c30b9ebe
commit 9e4f4edb92
21 changed files with 98 additions and 163 deletions

View file

@ -61,7 +61,7 @@ function session__nameless() -> string { return "" }
export state SessionState {
session__me_sleeping: bool = false
session__slot: []PartyMember = null
session__slot: []PartyMember = session__slots()
session__role: int = 0
session__max: int = 4
session__open: bool = true
@ -92,10 +92,11 @@ function session__fact(session_st: SessionState, what: int, slot: int, pid: int)
return f
}
function session__init(session_st: mut SessionState) -> void {
if session_st.session__slot != null { return }
session_st.session__slot = new []PartyMember
for i in 0 .. PLY_MAX { push(session_st.session__slot, new PartyMember) }
session_st.session__slot[0].on = true
}
function session__facts__new() -> Queue<SessionFact> { return queue_new("session.facts") }
# the roster's slots, slot 0 this machine's own and on
function session__slots() -> []PartyMember {
let out = new []PartyMember
for i in 0 .. PLY_MAX { push(out, new PartyMember) }
out[0].on = true
return out
}