[−][src]Struct world_map_gen::gen::RandomBoardGen
Random world map board generator
Methods
impl RandomBoardGen<StdRng>
[src]
pub fn from_seed(seed: u64) -> Self
[src]
Create a new random map generator. It's internal random number generator is initialized by the given seed. Standard random number generator is used.
impl<R: Rng> RandomBoardGen<R>
[src]
pub fn gen(
&mut self,
resolution: Option<Resolution>,
width: Option<usize>,
height: Option<usize>
) -> Result<Board<'static>>
[src]
&mut self,
resolution: Option<Resolution>,
width: Option<usize>,
height: Option<usize>
) -> Result<Board<'static>>
Most generic method to generate a random map. When resolution is None
, the resolution is
determined from its size. When width and/or height are None
they will be determined from
the terminal size. In the case, when terminal size cannot be obtained, this method returns
an error.
pub fn gen_auto(&mut self, width: usize, height: usize) -> Board<'static>
[src]
Generate a random map of given width and height. Resolution is automatically determined from its size.
- When width and height are lower than 15: low resolution
- When width and height are lower than 120: middle resolution
- Otherwise: high resolution
pub fn gen_small(&mut self, width: usize, height: usize) -> Board<'static>
[src]
Generate a low resolution random map of given width and height.
pub fn gen_middle(&mut self, width: usize, height: usize) -> Board<'static>
[src]
Generate a middle resolution random map of given width and height.
pub fn gen_large(&mut self, width: usize, height: usize) -> Board<'static>
[src]
Generate a large resolution random map of given width and height.
Trait Implementations
impl Default for RandomBoardGen<ThreadRng>
[src]
Auto Trait Implementations
impl<R> Send for RandomBoardGen<R> where
R: Send,
R: Send,
impl<R> Sync for RandomBoardGen<R> where
R: Sync,
R: Sync,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,