pub struct World { /* private fields */ }Expand description
Multiple independent infinite Fields (one per monitor space), plus optional adjacency (portals) between them.
Implementations§
Source§impl World
impl World
pub fn new() -> Self
pub fn add_space(&mut self, id: SpaceId, field: Field)
pub fn space(&self, id: SpaceId) -> Option<&Field>
pub fn space_mut(&mut self, id: SpaceId) -> Option<&mut Field>
Sourcepub fn set_neighbor(&mut self, a: SpaceId, dir: PortalDir, b: SpaceId)
pub fn set_neighbor(&mut self, a: SpaceId, dir: PortalDir, b: SpaceId)
Define a portal edge from a in direction dir to b.
You typically set both directions (a->b and b->a).
pub fn neighbor(&self, a: SpaceId, dir: PortalDir) -> Option<SpaceId>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for World
impl RefUnwindSafe for World
impl Send for World
impl Sync for World
impl Unpin for World
impl UnsafeUnpin for World
impl UnwindSafe for World
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more