TaskManager: queue, cancel, and next_for(pawn) selection #67
Labels
No labels
assets
bug
duplicate
enhancement
help wanted
invalid
question
testing
ui
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
liamjd/UntitledColonyBuilder#67
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of milestone #5. Depends on #66.
The queue every user action feeds, and the thing an idle pawn asks for work. Pure logic node, no rendering, headless-testable with stub tasks.
API:
add(task) -> intassigns id and creation sequence, emitstask_addedcancel(id),complete(id)with matching signalsnext_for(pawn) -> Task: highest priority first, then oldest first; skips tasks whosecan_start(ctx)is false and marks them BLOCKED; returns null when nothing is workableclaim(id, pawn)/release(id)so a pawn that fails mid-task hands it back as PENDINGall()andby_status()for the debug panelDesign notes:
task.prioritydirectly. The design docs require an Emergency Protocols override that reprioritises all labour in one action; that becomes a swap of the policy, not a rewrite of selection.next_forcall, not left blocked forever; a later issue can add event-driven unblocking.GameStateif other systems need them without a reference; decide and note in the PR).AC: