pub trait WorldMutType<P, E>: WorldRefType<P, E> + ProtocolInserter<P, E> where
    P: ProtocolType
{ fn spawn_entity(&mut self) -> E;
fn despawn_entity(&mut self, entity: &E);
fn get_component_kinds(
        &mut self,
        entity: &E
    ) -> Vec<<P as ProtocolType>::Kind, Global>
Notable traits for Vec<u8, A>
impl<A> Write for Vec<u8, A> where
    A: Allocator
;
fn get_component_mut<R>(
        &'a mut self,
        entity: &E
    ) -> Option<ReplicaMutWrapper<'a, P, R>>
    where
        R: ReplicateSafe<P>
;
fn component_read_partial(
        &mut self,
        entity: &E,
        component_kind: &<P as ProtocolType>::Kind,
        diff_mask: &DiffMask,
        reader: &mut PacketReader<'_>,
        packet_index: u16
    );
fn mirror_components(
        &mut self,
        mutable_entity: &E,
        immutable_entity: &E,
        component_kind: &<P as ProtocolType>::Kind
    );
fn insert_component<R>(&mut self, entity: &E, component_ref: R)
    where
        R: ReplicateSafe<P>
;
fn remove_component<R>(&mut self, entity: &E) -> Option<R>
    where
        R: Replicate<P>
;
fn remove_component_of_kind(
        &mut self,
        entity: &E,
        component_kind: &<P as ProtocolType>::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

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 state of the same component owned by 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