Struct rpgtools::map::GridMap [−][src]
Implementations
impl GridMap
[src]
pub fn new(xmax: usize, ymax: usize) -> GridMap
[src]
Make a new GridMap
pub fn place_entrance(&mut self, (x, y): (usize, usize))
[src]
Set the entrance at a particular location. The cell at this location will be marked as having the entrance area type. Typcially this will be coloured differently on a map.
pub fn place_entrance_near(
&mut self,
(x, y): (usize, usize)
) -> Result<(), &'static str>
[src]
&mut self,
(x, y): (usize, usize)
) -> Result<(), &'static str>
Similar to place entrance, however it starts with the coordinates and finds the nearest spot that is already a “room”. This allows entrances to be placed in non-deterministic generators, such as caves.
pub fn place_room(&mut self, (x0, y0): (usize, usize), (x1, y1): (usize, usize))
[src]
Set a room
pub fn place_room_dimensions(
&mut self,
(x, y): (usize, usize),
(w, h): (isize, isize)
)
[src]
&mut self,
(x, y): (usize, usize),
(w, h): (isize, isize)
)
Place a room by setting the origin and width/height
Arguments:
- (x, y) -> The origin of the room. This will be a corner.
- (w, h) -> Width/Height of the room. Note, they’re isize because you can specify the w/h to be left OR right of the origin and up OR down, respectively.
pub fn place_hallway(
&mut self,
(x0, y0): (usize, usize),
(x1, y1): (usize, usize),
route: RouteMethod
)
[src]
&mut self,
(x0, y0): (usize, usize),
(x1, y1): (usize, usize),
route: RouteMethod
)
Place a hallway between two points
pub fn generate_random_cells(&mut self, limit: i64)
[src]
Generate random cells with a biasing towards more/less rooms. Limit is a value between 1 and 100. This limit sets the chance that the cells are a room. Higher limit means fewer rooms.
pub fn generate_annealed_random_cells(&mut self)
[src]
pub fn place_random_room(&mut self, scale: usize, connect: bool)
[src]
Place a randomly sized room of up to scale length or width.
pub fn generate_cave(&mut self, iter: i64, seed_limit: i64)
[src]
pub fn draw_to_file(&self, filename: &str, scale: usize) -> Result<(), Error>
[src]
Make a PNG file of the gridmap
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for GridMap
impl Send for GridMap
impl Sync for GridMap
impl Unpin for GridMap
impl UnwindSafe for GridMap
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,