[−][src]Struct specs_task::TaskManager
The main object for users of this module. Manages all non-background task operations.
Methods
impl<'_> TaskManager<'_>
[src]
pub fn make_task<'a, T: TaskComponent<'a>>(
&mut self,
task: T,
entities: &Entities,
tasks: &mut WriteStorage<T>
) -> Entity
[src]
&mut self,
task: T,
entities: &Entities,
tasks: &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_fork(&mut self, entities: &Entities) -> Entity
[src]
Create a new fork entity with no children.
pub fn add_prong(
&mut self,
fork_entity: Entity,
prong: Entity
) -> Result<(), UnexpectedEntity>
[src]
&mut self,
fork_entity: Entity,
prong: Entity
) -> Result<(), UnexpectedEntity>
Add prong
as a child on the MultiEdge
of fork_entity
.
pub fn join(
&mut self,
parent: Entity,
child: Entity
) -> Result<(), AlreadyJoined>
[src]
&mut self,
parent: Entity,
child: Entity
) -> Result<(), AlreadyJoined>
Creates a SingleEdge
from parent
to child
. Creates a fork-join if parent
is a fork.
pub fn finalize(&mut self, entity: Entity, delete_on_completion: bool)
[src]
Mark entity
as final. This will make all of entity
's descendents visible to the
TaskManagerSystem
, allowing them to make progress. If delete_on_completion
is true, 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, entity: Entity) -> bool
[src]
Returns true iff the task was seen as complete on the last run of the TaskManagerSystem
.
WARNING: assumes that this entity was at one point a task, and it can't tell otherwise.
pub fn entity_is_complete(&self, entity: Entity) -> bool
[src]
Tells you whether a fork or a task entity is complete.
WARNING: assumes that this entity was at one point a task or a fork, and it can't tell otherwise.
pub fn delete_descendents(&self, entity: Entity, entities: &Entities)
[src]
Deletes only the descendent entities of entity
, but leaves entity
alive.
pub fn delete_entity_and_descendents(&self, entity: Entity, entities: &Entities)
[src]
Deletes entity
and all of its descendents.
Trait Implementations
impl<'a> SystemData<'a> for TaskManager<'a> where
WriteStorage<'a, TaskProgress>: SystemData<'a>,
WriteStorage<'a, SingleEdge>: SystemData<'a>,
WriteStorage<'a, MultiEdge>: SystemData<'a>,
WriteStorage<'a, FinalTag>: SystemData<'a>,
[src]
WriteStorage<'a, TaskProgress>: SystemData<'a>,
WriteStorage<'a, SingleEdge>: SystemData<'a>,
WriteStorage<'a, MultiEdge>: SystemData<'a>,
WriteStorage<'a, FinalTag>: SystemData<'a>,
Auto Trait Implementations
impl<'a> !RefUnwindSafe for TaskManager<'a>
impl<'a> Send for TaskManager<'a>
impl<'a> Sync for TaskManager<'a>
impl<'a> Unpin for TaskManager<'a>
impl<'a> !UnwindSafe for TaskManager<'a>
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> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,
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 + Send + Sync,
T: Any + Send + Sync,
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>,