pub enum Effect {
SpawnPlayerCharacter {
handle: PcHandle,
position: Point,
},
DespawnPlayerCharacter(PcHandle),
MovePlayerCharacter {
handle: PcHandle,
old_position: Point,
new_position: Point,
},
}
Expand description
An effect applied to a Chunk that will change its state deterministically.
Variants
SpawnPlayerCharacter
DespawnPlayerCharacter(PcHandle)
MovePlayerCharacter
Implementations
sourceimpl Effect
impl Effect
sourcepub fn apply_effect(self, time: WorldInstant, chunk: &mut Chunk)
pub fn apply_effect(self, time: WorldInstant, chunk: &mut Chunk)
Applies the effect to a Chunk. The time should be the World::time matching this Effect.
See also: ServerAction::Effects.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Effect
impl<'de> Deserialize<'de> for Effect
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Effect
impl Send for Effect
impl Sync for Effect
impl Unpin for Effect
impl UnwindSafe for Effect
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more