pub enum EntityCommand {
Show 14 variants
Spawn(GlobalEntity),
SpawnWithComponents(GlobalEntity, Vec<ComponentKind>),
Despawn(GlobalEntity),
InsertComponent(GlobalEntity, ComponentKind),
RemoveComponent(GlobalEntity, ComponentKind),
Publish(Option<SubCommandId>, GlobalEntity),
Unpublish(Option<SubCommandId>, GlobalEntity),
EnableDelegation(Option<SubCommandId>, GlobalEntity),
DisableDelegation(Option<SubCommandId>, GlobalEntity),
SetAuthority(Option<SubCommandId>, GlobalEntity, EntityAuthStatus),
RequestAuthority(Option<SubCommandId>, GlobalEntity),
ReleaseAuthority(Option<SubCommandId>, GlobalEntity),
EnableDelegationResponse(Option<SubCommandId>, GlobalEntity),
MigrateResponse(Option<SubCommandId>, GlobalEntity, RemoteEntity, HostEntity),
}Expand description
Wire command syncing entity lifecycle and authority transitions from host to remote.
Variants§
Spawn(GlobalEntity)
Spawn an entity with no initial components.
SpawnWithComponents(GlobalEntity, Vec<ComponentKind>)
Spawn an entity pre-loaded with the listed component kinds.
Despawn(GlobalEntity)
Despawn an existing entity.
InsertComponent(GlobalEntity, ComponentKind)
Insert a component onto an existing entity.
RemoveComponent(GlobalEntity, ComponentKind)
Remove a component from an existing entity.
Publish(Option<SubCommandId>, GlobalEntity)
Publish a delegated entity so it becomes visible to other users.
Unpublish(Option<SubCommandId>, GlobalEntity)
Retract a previously published entity.
EnableDelegation(Option<SubCommandId>, GlobalEntity)
Enable client-authority delegation for an entity.
DisableDelegation(Option<SubCommandId>, GlobalEntity)
Revoke client-authority delegation (server only).
SetAuthority(Option<SubCommandId>, GlobalEntity, EntityAuthStatus)
Update the authority status for a delegated entity (server only).
RequestAuthority(Option<SubCommandId>, GlobalEntity)
Client requests authority over a delegated entity.
ReleaseAuthority(Option<SubCommandId>, GlobalEntity)
Client releases previously held authority.
EnableDelegationResponse(Option<SubCommandId>, GlobalEntity)
Client acknowledges that delegation has been enabled.
MigrateResponse(Option<SubCommandId>, GlobalEntity, RemoteEntity, HostEntity)
Server notifies that an entity has migrated from remote to host (subid, global, old_remote, new_host).
Implementations§
Source§impl EntityCommand
impl EntityCommand
Sourcepub fn entity(&self) -> GlobalEntity
pub fn entity(&self) -> GlobalEntity
Returns the primary GlobalEntity this command targets.
Sourcepub fn component_kind(&self) -> Option<ComponentKind>
pub fn component_kind(&self) -> Option<ComponentKind>
Returns the ComponentKind for insert/remove commands, or None for all other variants.
Sourcepub fn get_type(&self) -> EntityMessageType
pub fn get_type(&self) -> EntityMessageType
Returns the EntityMessageType discriminant for this command.
Sourcepub fn is_valid_for_remote_entity(&self) -> bool
pub fn is_valid_for_remote_entity(&self) -> bool
Returns true if this command can be applied to a remote (client-owned) entity.
Trait Implementations§
Source§impl Clone for EntityCommand
impl Clone for EntityCommand
Source§fn clone(&self) -> EntityCommand
fn clone(&self) -> EntityCommand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EntityCommand
impl Debug for EntityCommand
Source§impl PartialEq for EntityCommand
impl PartialEq for EntityCommand
Source§fn eq(&self, other: &EntityCommand) -> bool
fn eq(&self, other: &EntityCommand) -> bool
self and other values to be equal, and is used by ==.