[−][src]Struct specs_task::TaskData
Implementations
impl<'a, P, S, M, F> TaskData<'a, P, S, M, F> where
P: GenericReadStorage<Component = TaskProgress>,
S: GenericReadStorage<Component = SingleEdge>,
M: GenericReadStorage<Component = MultiEdge>,
&'a P: 'a + Join,
[src]
P: GenericReadStorage<Component = TaskProgress>,
S: GenericReadStorage<Component = SingleEdge>,
M: GenericReadStorage<Component = MultiEdge>,
&'a P: 'a + Join,
pub fn make_task_with_entity_lazy<'b, T: TaskComponent<'b> + Send + Sync>(
&self,
entity: Entity,
task: T
)
[src]
&self,
entity: Entity,
task: T
)
Like make_task
, but use entity
for tracking the task components. This can make it easier
to manage tasks coupled with a specific entity (rather than storing a separate task entity
in a component).
pub fn make_task_lazy<'b, T: TaskComponent<'b> + Send + Sync>(
&self,
task: T
) -> Entity
[src]
&self,
task: T
) -> Entity
Create a new task entity with the given TaskComponent
. The task will not make progress
until it is either finalized or the descendent of a finalized entity.
pub fn make_final_task_lazy<'b, T: TaskComponent<'b> + Send + Sync>(
&self,
task: T,
on_completion: OnCompletion
) -> Entity
[src]
&self,
task: T,
on_completion: OnCompletion
) -> Entity
pub fn make_fork_lazy(&self) -> Entity
[src]
Create a new fork entity with no children.
pub fn add_prong_lazy(&self, fork_entity: Entity, prong: Entity)
[src]
Add prong
as a child on the MultiEdge
of fork_entity
.
pub fn join_lazy(&self, parent: Entity, child: Entity)
[src]
Creates a SingleEdge
from parent
to child
. Creates a fork-join if parent
is a fork.
pub fn finalize_lazy(&self, entity: Entity, on_completion: OnCompletion)
[src]
Mark entity
as final. This will make all of entity
's descendents visible to the
TaskManagerSystem
, allowing them to make progress. If OnCompletion::Delete
, then
entity
and all of its descendents will be deleted when entity
is complete (and hence the
entire graph is complete). Otherwise, you need to clean up the entities your self by calling
delete_entity_and_descendents
. God help you if you leak an orphaned entity.
pub fn task_is_complete(&self, task: Entity) -> bool
[src]
Returns true iff the task was seen as complete on the last run of the TaskManagerSystem
.
pub fn entity_is_complete(&self, entity: Entity) -> bool
[src]
Tells you whether a fork or a task entity is complete.
pub fn count_tasks_in_progress(&'a self) -> usize
[src]
Returns the number of tasks that haven't yet completed.
pub fn delete_entity_and_descendents(&self, entity: Entity)
[src]
Deletes entity
and all of its descendents.
pub fn delete_if_complete(&self, entity: Entity) -> bool
[src]
Deletes the entity and descendents if they are all complete. Returns true iff the entity and all descendents are complete.
impl<'a> TaskData<'a, Storage<'a, TaskProgress, FetchMut<'a, MaskedStorage<TaskProgress>>>, Storage<'a, SingleEdge, FetchMut<'a, MaskedStorage<SingleEdge>>>, Storage<'a, MultiEdge, FetchMut<'a, MaskedStorage<MultiEdge>>>, Storage<'a, FinalTag, FetchMut<'a, MaskedStorage<FinalTag>>>>
[src]
pub fn make_task_with_entity<'b, T: TaskComponent<'b> + Send + Sync>(
&mut self,
entity: Entity,
task: T,
task_storage: &mut WriteStorage<T>
)
[src]
&mut self,
entity: Entity,
task: T,
task_storage: &mut WriteStorage<T>
)
Like make_task
, but use entity
for tracking the task components.
pub fn make_task<'b, T: TaskComponent<'b> + Send + Sync>(
&mut self,
task: T,
task_storage: &mut WriteStorage<T>
) -> Entity
[src]
&mut self,
task: T,
task_storage: &mut WriteStorage<T>
) -> Entity
Create a new task entity with the given TaskComponent
. The task will not make progress
until it is either finalized or the descendent of a finalized entity.
pub fn make_final_task_with_entity<'b, T: TaskComponent<'b> + Send + Sync>(
&mut self,
entity: Entity,
task: T,
on_completion: OnCompletion,
task_storage: &mut WriteStorage<T>
) -> Entity
[src]
&mut self,
entity: Entity,
task: T,
on_completion: OnCompletion,
task_storage: &mut WriteStorage<T>
) -> Entity
Same as make_task_with_entity
, but also finalizes the task.
pub fn make_final_task<'b, T: TaskComponent<'b> + Send + Sync>(
&mut self,
task: T,
on_completion: OnCompletion,
task_storage: &mut WriteStorage<T>
) -> Entity
[src]
&mut self,
task: T,
on_completion: OnCompletion,
task_storage: &mut WriteStorage<T>
) -> Entity
Same as make_task
, but also finalizes the task.
pub fn make_fork(&mut self) -> Entity
[src]
Create a new fork entity with no children.
pub fn add_prong(&mut self, fork_entity: Entity, prong: Entity)
[src]
Add prong
as a child on the MultiEdge
of fork_entity
.
pub fn join(&mut self, parent: Entity, child: Entity)
[src]
Creates a SingleEdge
from parent
to child
. Creates a fork-join if parent
is a fork.
pub fn finalize(&mut self, entity: Entity, on_completion: OnCompletion)
[src]
Mark entity
as final. This will make all of entity
's descendents visible to the
TaskManagerSystem
, allowing them to make progress. If OnCompletion::Delete
, then
entity
and all of its descendents will be deleted when entity
is complete (and hence the
entire graph is complete). Otherwise, you need to clean up the entities your self by calling
delete_entity_and_descendents
. God help you if you leak an orphaned entity.
Trait Implementations
impl<'a, P, S, M, F> SystemData<'a> for TaskData<'a, P, S, M, F> where
Entities<'a>: SystemData<'a>,
Read<'a, LazyUpdate>: SystemData<'a>,
P: SystemData<'a>,
S: SystemData<'a>,
M: SystemData<'a>,
F: SystemData<'a>,
[src]
Entities<'a>: SystemData<'a>,
Read<'a, LazyUpdate>: SystemData<'a>,
P: SystemData<'a>,
S: SystemData<'a>,
M: SystemData<'a>,
F: SystemData<'a>,
Auto Trait Implementations
impl<'a, P, S, M, F> !RefUnwindSafe for TaskData<'a, P, S, M, F>
impl<'a, P, S, M, F> !Send for TaskData<'a, P, S, M, F>
impl<'a, P, S, M, F> !Sync for TaskData<'a, P, S, M, F>
impl<'a, P, S, M, F> Unpin for TaskData<'a, P, S, M, F> where
F: Unpin,
M: Unpin,
P: Unpin,
S: Unpin,
F: Unpin,
M: Unpin,
P: Unpin,
S: Unpin,
impl<'a, P, S, M, F> !UnwindSafe for TaskData<'a, P, S, M, F>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> DynamicSystemData<'a> for T where
T: SystemData<'a>,
T: SystemData<'a>,
type Accessor = StaticAccessor<T>
The accessor of the SystemData
, which specifies the read and write dependencies and does the fetching. Read more
fn setup(&StaticAccessor<T>, world: &mut World)
fn fetch(&StaticAccessor<T>, world: &'a World) -> T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Resource for T where
T: Any,
T: Any,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,