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:
parent
63c30b9ebe
commit
9e4f4edb92
21 changed files with 98 additions and 163 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# lists.ludic - the written jobs as a screen lists them: a vendor's, the taken, the ones to show
|
||||
# a vendor's offers and the ones it can take back, in a group (-1 every vendor)
|
||||
export function jobs_at(jobs_st: mut JobsState, group: int, vendor: int) -> []int {
|
||||
export function jobs_at(jobs_st: JobsState, group: int, vendor: int) -> []int {
|
||||
let out = new []int
|
||||
for i in 0 .. JOB_COUNT {
|
||||
let d = Jobs[i]
|
||||
|
|
@ -13,14 +13,14 @@ export function jobs_at(jobs_st: mut JobsState, group: int, vendor: int) -> []in
|
|||
}
|
||||
|
||||
# every job of a group taken at some point, done ones too
|
||||
export function jobs_taken(jobs_st: mut JobsState, group: int) -> []int {
|
||||
export function jobs_taken(jobs_st: JobsState, group: int) -> []int {
|
||||
let out = new []int
|
||||
for i in 0 .. JOB_COUNT { if Jobs[i].group == group and jobs_state(jobs_st, i) != JOBS_OFFERED { push(out, i) } }
|
||||
return out
|
||||
}
|
||||
|
||||
# the first `most` of a group under way
|
||||
export function jobs_shown(jobs_st: mut JobsState, group: int, most: int) -> []int {
|
||||
export function jobs_shown(jobs_st: JobsState, group: int, most: int) -> []int {
|
||||
let out = new []int
|
||||
for i in 0 .. JOB_COUNT {
|
||||
if len(out) >= most { break }
|
||||
|
|
@ -30,7 +30,7 @@ export function jobs_shown(jobs_st: mut JobsState, group: int, most: int) -> []i
|
|||
}
|
||||
|
||||
# the first under way and not yet met, or -1
|
||||
export function jobs_first_open(jobs_st: mut JobsState, group: int) -> int {
|
||||
export function jobs_first_open(jobs_st: JobsState, group: int) -> int {
|
||||
for i in 0 .. JOB_COUNT { if Jobs[i].group == group and jobs_state(jobs_st, i) == JOBS_ACTIVE { return i } }
|
||||
return -1
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue