[][src]Trait naia_server::ActorType

pub trait ActorType<Impl = Self>: Clone {
    fn read_full(&mut self, reader: &mut PacketReader<'_>, packet_index: u16);
fn read_partial(
        &mut self,
        state_mask: &StateMask,
        reader: &mut PacketReader<'_>,
        packet_index: u16
    );
fn inner_ref(&self) -> Rc<RefCell<dyn Actor<Impl> + 'static>>;
fn equals(&self, other: &Impl) -> bool;
fn equals_prediction(&self, other: &Impl) -> bool;
fn set_to_interpolation(&mut self, old: &Impl, new: &Impl, fraction: f32);
fn mirror(&mut self, other: &Impl);
fn is_interpolated(&self) -> bool;
fn is_predicted(&self) -> bool; }

An Enum with a variant for every Actor that can be synced between Client/Host

Required methods

fn read_full(&mut self, reader: &mut PacketReader<'_>, packet_index: u16)

Read bytes from an incoming packet into all contained Properties

fn read_partial(
    &mut self,
    state_mask: &StateMask,
    reader: &mut PacketReader<'_>,
    packet_index: u16
)

Read bytes from an incoming packet, updating the Properties which have been mutated on the Server

fn inner_ref(&self) -> Rc<RefCell<dyn Actor<Impl> + 'static>>

Convert ActorType to an inner reference to the Actor

fn equals(&self, other: &Impl) -> bool

Compare properties in another ActorType

fn equals_prediction(&self, other: &Impl) -> bool

Compare predicted properties in another ActorType

fn set_to_interpolation(&mut self, old: &Impl, new: &Impl, fraction: f32)

Sets the current Actor to an interpolated state between two other Actors of the same type

fn mirror(&mut self, other: &Impl)

Sets the current Actor to an interpolated state between itself and another Actor of the same type

fn is_interpolated(&self) -> bool

Returns whether or not the Actor has any interpolated properties

fn is_predicted(&self) -> bool

Returns whether or not the Actor has any predicted properties

Loading content...

Implementors

Loading content...