Define the Task data model #66
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#66
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. The generic base that every task type extends. Pure data plus abstract hooks, so it is headless-testable and serialisable, following the same record-is-the-truth pattern as
Building.Design:
Task extends Entity(RefCounted), with@abstracthooks the wayEntityitself is declaredid(manager-assigned, never reused),priority(int, higher first),created_seq(creation order),status,parent,children,target_cell: Vector2i(where a pawn must stand to work it),required_role(for specialisation, see the later issue),assignee(pawn id or -1),work_remainingStatusenum: PENDING, CLAIMED, IN_PROGRESS, BLOCKED, COMPLETE, CANCELLEDcan_start(ctx) -> bool(resources, reachability),work(ctx, ticks) -> void,on_complete(ctx),on_cancel(ctx)ctxis a small context object handing the task what it may touch (Buildings registry, later resources) rather than tasks reaching for autoloadsAC:
Adding a new task type must require only a new subclass, no changes to the manager.