Struct veloren_common::comp::group::GroupManager
source · pub struct GroupManager {
groups: Slab<GroupInfo>,
}
Fields§
§groups: Slab<GroupInfo>
Implementations§
source§impl GroupManager
impl GroupManager
pub fn group_info(&self, group: Group) -> Option<&GroupInfo>
fn group_info_mut(&mut self, group: Group) -> Option<&mut GroupInfo>
fn create_group(&mut self, leader: Entity, num_members: u32) -> Group
fn remove_group(&mut self, group: Group)
pub fn add_group_member( &mut self, leader: Entity, new_member: Entity, entities: &Entities<'_>, groups: &mut WriteStorage<'_, Group>, alignments: &ReadStorage<'_, Alignment>, uids: &ReadStorage<'_, Uid>, notifier: impl FnMut(Entity, ChangeNotification<Entity>), )
pub fn new_pet( &mut self, pet: Entity, owner: Entity, groups: &mut WriteStorage<'_, Group>, entities: &Entities<'_>, alignments: &ReadStorage<'_, Alignment>, uids: &ReadStorage<'_, Uid>, notifier: &mut impl FnMut(Entity, ChangeNotification<Entity>), )
pub fn leave_group( &mut self, member: Entity, groups: &mut WriteStorage<'_, Group>, alignments: &ReadStorage<'_, Alignment>, uids: &ReadStorage<'_, Uid>, entities: &Entities<'_>, notifier: &mut impl FnMut(Entity, ChangeNotification<Entity>), )
pub fn entity_deleted( &mut self, member: Entity, groups: &mut WriteStorage<'_, Group>, alignments: &ReadStorage<'_, Alignment>, uids: &ReadStorage<'_, Uid>, entities: &EntitiesRes, notifier: &mut impl FnMut(Entity, ChangeNotification<Entity>), )
fn remove_from_group( &mut self, member: Entity, groups: &mut WriteStorage<'_, Group>, alignments: &ReadStorage<'_, Alignment>, uids: &ReadStorage<'_, Uid>, entities: &EntitiesRes, notifier: &mut impl FnMut(Entity, ChangeNotification<Entity>), to_be_deleted: bool, )
pub fn assign_leader<'a>( &mut self, new_leader: Entity, groups: impl GenericReadStorage<Component = Group> + Join<Type = &'a Group> + 'a, entities: &'a Entities<'_>, alignments: &'a ReadStorage<'_, Alignment>, uids: &'a ReadStorage<'_, Uid>, notifier: impl FnMut(Entity, ChangeNotification<Entity>), )
Trait Implementations§
source§impl Debug for GroupManager
impl Debug for GroupManager
source§impl Default for GroupManager
impl Default for GroupManager
source§fn default() -> GroupManager
fn default() -> GroupManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GroupManager
impl RefUnwindSafe for GroupManager
impl Send for GroupManager
impl Sync for GroupManager
impl Unpin for GroupManager
impl UnwindSafe for GroupManager
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<Context> SubContext<Context> for Context
impl<Context> SubContext<Context> for Context
fn sub_context(self) -> Context
§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere
T: Default,
§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
Tries to create the default.
§fn unwrap_default() -> Self
fn unwrap_default() -> Self
Calls
try_default
and panics on an error case.