pub trait WorldMutType<E>: WorldRefType<E> {
Show 23 methods // Required methods fn spawn_entity(&mut self) -> E; fn local_duplicate_entity(&mut self, entity: &E) -> E; fn local_duplicate_components( &mut self, mutable_entity: &E, immutable_entity: &E ); fn despawn_entity(&mut self, entity: &E); fn component_kinds(&mut self, entity: &E) -> Vec<ComponentKind>; fn component_mut<'a, R: Replicate>( &'a mut self, entity: &E ) -> Option<ReplicaMutWrapper<'a, R>>; fn component_mut_of_kind<'a>( &'a mut self, entity: &E, component_kind: &ComponentKind ) -> Option<ReplicaDynMutWrapper<'a>>; fn component_apply_update( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, entity: &E, component_kind: &ComponentKind, update: ComponentUpdate ) -> Result<(), SerdeErr>; fn component_apply_field_update( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, entity: &E, component_kind: &ComponentKind, update: ComponentFieldUpdate ) -> Result<(), SerdeErr>; fn mirror_entities(&mut self, mutable_entity: &E, immutable_entity: &E); fn mirror_components( &mut self, mutable_entity: &E, immutable_entity: &E, component_kind: &ComponentKind ); fn insert_component<R: Replicate>(&mut self, entity: &E, component_ref: R); fn insert_boxed_component( &mut self, entity: &E, boxed_component: Box<dyn Replicate> ); fn remove_component<R: Replicate>(&mut self, entity: &E) -> Option<R>; fn remove_component_of_kind( &mut self, entity: &E, component_kind: &ComponentKind ) -> Option<Box<dyn Replicate>>; fn entity_publish( &mut self, global_world_manager: &dyn GlobalWorldManagerType<E>, entity: &E ); fn component_publish( &mut self, global_world_manager: &dyn GlobalWorldManagerType<E>, entity: &E, component_kind: &ComponentKind ); fn entity_unpublish(&mut self, entity: &E); fn component_unpublish( &mut self, entity: &E, component_kind: &ComponentKind ); fn entity_enable_delegation( &mut self, global_world_manager: &dyn GlobalWorldManagerType<E>, entity: &E ); fn component_enable_delegation( &mut self, global_world_manager: &dyn GlobalWorldManagerType<E>, entity: &E, component_kind: &ComponentKind ); fn entity_disable_delegation(&mut self, entity: &E); fn component_disable_delegation( &mut self, entity: &E, component_kind: &ComponentKind );
}
Expand description

Structures that implement the WorldMutType trait will be able to be loaded into the Server at which point the Server will use this interface to keep the WorldMutType in-sync with it’s own Entities/Components

Required Methods§

source

fn spawn_entity(&mut self) -> E

spawn an entity

source

fn local_duplicate_entity(&mut self, entity: &E) -> E

duplicate an entity

source

fn local_duplicate_components( &mut self, mutable_entity: &E, immutable_entity: &E )

make it so one entity has all the same components as another

source

fn despawn_entity(&mut self, entity: &E)

despawn an entity

source

fn component_kinds(&mut self, entity: &E) -> Vec<ComponentKind>

gets all of an Entity’s Components

source

fn component_mut<'a, R: Replicate>( &'a mut self, entity: &E ) -> Option<ReplicaMutWrapper<'a, R>>

gets an entity’s component

source

fn component_mut_of_kind<'a>( &'a mut self, entity: &E, component_kind: &ComponentKind ) -> Option<ReplicaDynMutWrapper<'a>>

gets an entity’s component, dynamically

source

fn component_apply_update( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, entity: &E, component_kind: &ComponentKind, update: ComponentUpdate ) -> Result<(), SerdeErr>

reads an incoming stream into a component

source

fn component_apply_field_update( &mut self, converter: &dyn LocalEntityAndGlobalEntityConverter, entity: &E, component_kind: &ComponentKind, update: ComponentFieldUpdate ) -> Result<(), SerdeErr>

reads an incoming stream into a component

source

fn mirror_entities(&mut self, mutable_entity: &E, immutable_entity: &E)

mirrors the whole state of two different entities (setting 1st entity’s component to 2nd entity’s component’s state)

source

fn mirror_components( &mut self, mutable_entity: &E, immutable_entity: &E, component_kind: &ComponentKind )

mirrors the state of the same component of two different entities (setting 1st entity’s component to 2nd entity’s component’s state)

source

fn insert_component<R: Replicate>(&mut self, entity: &E, component_ref: R)

insert a component

source

fn insert_boxed_component( &mut self, entity: &E, boxed_component: Box<dyn Replicate> )

insert a boxed component

source

fn remove_component<R: Replicate>(&mut self, entity: &E) -> Option<R>

remove a component

source

fn remove_component_of_kind( &mut self, entity: &E, component_kind: &ComponentKind ) -> Option<Box<dyn Replicate>>

remove a component by kind

source

fn entity_publish( &mut self, global_world_manager: &dyn GlobalWorldManagerType<E>, entity: &E )

publish entity

source

fn component_publish( &mut self, global_world_manager: &dyn GlobalWorldManagerType<E>, entity: &E, component_kind: &ComponentKind )

publish component

source

fn entity_unpublish(&mut self, entity: &E)

unpublish entity

source

fn component_unpublish(&mut self, entity: &E, component_kind: &ComponentKind)

unpublish component

source

fn entity_enable_delegation( &mut self, global_world_manager: &dyn GlobalWorldManagerType<E>, entity: &E )

enable delegation on entity

source

fn component_enable_delegation( &mut self, global_world_manager: &dyn GlobalWorldManagerType<E>, entity: &E, component_kind: &ComponentKind )

enable delegation on component

source

fn entity_disable_delegation(&mut self, entity: &E)

disable delegation on entity

source

fn component_disable_delegation( &mut self, entity: &E, component_kind: &ComponentKind )

disable delegation on component

Object Safety§

This trait is not object safe.

Implementors§