pub struct MapLevel {
pub size: (u32, u32),
pub walkable: Field<bool>,
pub seen: Field<Glyph>,
pub drawn: Field<Glyph>,
pub rooms: HashMap<Point, StencilImpl>,
pub centers: Vec<Point>,
pub connected: HashSet<(Point, Point)>,
}
Fields
size: (u32, u32)
walkable: Field<bool>
seen: Field<Glyph>
drawn: Field<Glyph>
rooms: HashMap<Point, StencilImpl>
centers: Vec<Point>
connected: HashSet<(Point, Point)>
Implementations
sourceimpl MapLevel
impl MapLevel
pub fn new(size: (u32, u32)) -> MapLevel
pub fn mark_seen(&mut self, fov: &FieldOfView)
pub fn fov(&mut self, pt: &Point, distance: u16) -> FieldOfView
pub fn stamp_walkable(&mut self, stencil: &StencilImpl)
pub fn stamp_visible(&mut self, stencil: &StencilImpl, glyph: Glyph)
pub fn stamp_visible_and_walkable(
&mut self,
stencil: &StencilImpl,
glyph: Glyph
)
pub fn put_room(&mut self, stencil: &StencilImpl, glyph: Glyph)
pub fn connect(&mut self, a: Point, b: Point)
pub fn put_corridor(
&mut self,
a: Point,
b: Point,
stencil_fn: &dyn Fn(Point, Point) -> StencilImpl,
glyph: Glyph
)
pub fn is_connected(&mut self, a: Point, b: Point) -> bool
pub fn corridor_between(&self, a: Point, b: Point) -> (Point, Point, f32)
Trait Implementations
sourceimpl<'de> Deserialize<'de> for MapLevel
impl<'de> Deserialize<'de> for MapLevel
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 MapLevel
impl Send for MapLevel
impl Sync for MapLevel
impl Unpin for MapLevel
impl UnwindSafe for MapLevel
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
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more