pub struct HostWorldManager<E: Copy + Eq + Hash + Send + Sync> { /* private fields */ }
Expand description

Manages Entities for a given Client connection and keeps them in sync on the Client

Implementations§

source§

impl<E: Copy + Eq + Hash + Send + Sync> HostWorldManager<E>

source

pub fn new( address: &Option<SocketAddr>, global_world_manager: &dyn GlobalWorldManagerType<E> ) -> Self

Create a new HostWorldManager, given the client’s address

source

pub fn init_entity( &mut self, world_manager: &mut LocalWorldManager<E>, entity: &E, component_kinds: Vec<ComponentKind> )

source

pub fn spawn_entity( &mut self, world_manager: &mut LocalWorldManager<E>, entity: &E )

source

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

source

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

source

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

source

pub fn host_has_entity(&self, entity: &E) -> bool

source

pub fn entity_channel_is_open(&self, entity: &E) -> bool

source

pub fn queue_entity_message( &mut self, entities: Vec<E>, channel: &ChannelKind, message: MessageContainer )

source

pub fn collect_outgoing_messages( &mut self, now: &Instant, rtt_millis: &f32, handle_converter: &dyn NetEntityHandleConverter, message_kinds: &MessageKinds, message_manager: &mut MessageManager )

source

pub fn has_outgoing_messages(&self) -> bool

source

pub fn write_actions<W: WorldRefType<E>>( &mut self, component_kinds: &ComponentKinds, now: &Instant, writer: &mut BitWriter, packet_index: &PacketIndex, world: &W, global_world_manager: &dyn GlobalWorldManagerType<E>, local_world_manager: &LocalWorldManager<E>, has_written: &mut bool )

source

pub fn write_updates<W: WorldRefType<E>>( &mut self, component_kinds: &ComponentKinds, now: &Instant, writer: &mut BitWriter, packet_index: &PacketIndex, world: &W, global_world_manager: &dyn GlobalWorldManagerType<E>, local_world_manager: &LocalWorldManager<E>, has_written: &mut bool )

source§

impl<E: Copy + Eq + Hash + Send + Sync> HostWorldManager<E>

source

pub fn notify_packet_delivered( &mut self, packet_index: PacketIndex, local_world_manager: &mut LocalWorldManager<E> )

Auto Trait Implementations§

§

impl<E> !RefUnwindSafe for HostWorldManager<E>

§

impl<E> Send for HostWorldManager<E>

§

impl<E> Sync for HostWorldManager<E>

§

impl<E> Unpin for HostWorldManager<E>where E: Unpin,

§

impl<E> !UnwindSafe for HostWorldManager<E>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V