pub struct ReplicationGraph { /* private fields */ }Expand description
Replication graph with basic spatial relevance and dirty tracking.
Implementations§
Source§impl ReplicationGraph
impl ReplicationGraph
pub fn new(config: ReplicationConfig) -> Self
Sourcepub fn update_entity(
&mut self,
entity: EntityId,
position: Vec3,
dirty_components: &[ComponentId],
)
pub fn update_entity( &mut self, entity: EntityId, position: Vec3, dirty_components: &[ComponentId], )
Add or update a tracked entity.
Sourcepub fn set_entity_priority(&mut self, entity: EntityId, priority: u8)
pub fn set_entity_priority(&mut self, entity: EntityId, priority: u8)
Set entity priority (higher is more important).
Sourcepub fn remove_entity(&mut self, entity: EntityId)
pub fn remove_entity(&mut self, entity: EntityId)
Remove an entity and schedule destroy for all clients.
Sourcepub fn upsert_client(&mut self, client: ClientId, view: ClientView)
pub fn upsert_client(&mut self, client: ClientId, view: ClientView)
Update or insert client view configuration.
Sourcepub fn remove_client(&mut self, client: ClientId)
pub fn remove_client(&mut self, client: ClientId)
Remove a client and its known-entity state.
Sourcepub fn build_client_delta(
&mut self,
client: ClientId,
world: &impl WorldView,
) -> ClientDelta
pub fn build_client_delta( &mut self, client: ClientId, world: &impl WorldView, ) -> ClientDelta
Build the per-client delta (creates/destroys/updates) from current graph state.
Sourcepub fn clear_dirty(&mut self)
pub fn clear_dirty(&mut self)
Clear dirty flags after all clients have been processed for a tick.
Sourcepub fn clear_removed(&mut self)
pub fn clear_removed(&mut self)
Clear pending removals after all clients have processed destroys.
Trait Implementations§
Source§impl Clone for ReplicationGraph
impl Clone for ReplicationGraph
Source§fn clone(&self) -> ReplicationGraph
fn clone(&self) -> ReplicationGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ReplicationGraph
impl RefUnwindSafe for ReplicationGraph
impl Send for ReplicationGraph
impl Sync for ReplicationGraph
impl Unpin for ReplicationGraph
impl UnwindSafe for ReplicationGraph
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