pub trait WorldMutType<P: Protocolize, E>: WorldRefType<P, E> + ProtocolInserter<P, E> {
    fn spawn_entity(&mut self) -> E;
    fn duplicate_entity(&mut self, entity: &E) -> E;
    fn 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<P::Kind>;
    fn component_mut<'a, R: ReplicateSafe<P>>(
        &'a mut self,
        entity: &E
    ) -> Option<ReplicaMutWrapper<'a, P, R>>; fn component_apply_update(
        &mut self,
        converter: &dyn NetEntityHandleConverter,
        entity: &E,
        component_kind: &P::Kind,
        update: ComponentUpdate<P::Kind>
    ); fn mirror_entities(&mut self, mutable_entity: &E, immutable_entity: &E); fn mirror_components(
        &mut self,
        mutable_entity: &E,
        immutable_entity: &E,
        component_kind: &P::Kind
    ); fn insert_component<R: ReplicateSafe<P>>(
        &mut self,
        entity: &E,
        component_ref: R
    ); fn remove_component<R: Replicate<P>>(&mut self, entity: &E) -> Option<R>; fn remove_component_of_kind(
        &mut self,
        entity: &E,
        component_kind: &P::Kind
    ) -> Option<P>; }
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

spawn an entity

duplicate an entity

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

despawn an entity

gets all of an Entity’s Components as a list of Kinds

gets an entity’s component

reads an incoming stream into a component

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

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

insert a component

remove a component

remove a component by kind

Implementors