Add TaskCollection for waiting_on and children. #223
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Although there remains some debate over whether to use the
append
orreplace
method for managing thewaiting_on
list, I've decided to proceed with theappend
approach based on my past experiences. We are open to revising this if there is strong opposition.For instance, the code below demonstrates how to append "task1" and "task2" to the
waiting_on
list fortask3
, rather than replacing the existing list with ("task1", "task2"):TaskCollection
Implement a
TaskCollection
to store a collection of tasks. This is used for thewaiting_on
andchildren
attributes of the Task class. For example:waiting_on
Take
waiting_on
as an example:When adding or removing the task, it will check if the task exists or not.
Children
The children attribute is used to assign tasks to a Zone (e.g.,
While
zone orIf
zone). For example,