pub struct Maze {
pub power_up_positions: Vec<Position>,
/* private fields */
}Fields§
§power_up_positions: Vec<Position>Implementations§
Source§impl Maze
impl Maze
pub fn id(&self) -> usize
pub fn background_color() -> Rgba<u8>
Sourcepub fn random_seed(self, random_seed: u64) -> Self
pub fn random_seed(self, random_seed: u64) -> Self
Sets a maze rng and returns itself
Sourcepub const fn wall_size(self, wall_size: usize) -> Self
pub const fn wall_size(self, wall_size: usize) -> Self
Sets a maze wall_size and returns itself
Sourcepub const fn passage_size(self, passage_size: usize) -> Self
pub const fn passage_size(self, passage_size: usize) -> Self
Sets a maze passage_size and returns itself
pub fn new(id: usize) -> Self
pub fn build(self) -> AppResult<Self>
pub fn spawn_minotaur(&mut self, name: String) -> Minotaur
pub fn get_and_cache_visible_positions( &mut self, position: Position, direction: Direction, view: View, ) -> HashSet<Position>
pub fn get_cached_visible_positions( &self, position: Position, direction: Direction, view: View, ) -> HashSet<Position>
pub fn image(&self) -> &RgbaImage
pub fn save_image(&self, name: &str) -> AppResult<()>
pub fn is_valid_position(&self, position: Position) -> bool
pub fn is_valid_minotaur_position(&self, position: Position) -> bool
pub fn is_entrance_position(&self, position: Position) -> bool
pub fn is_exit_position(&self, position: Position) -> bool
pub fn entrance_positions(&self) -> &Vec<Position> ⓘ
pub fn exit_positions(&self) -> &Vec<Position> ⓘ
pub fn hero_starting_position(&self) -> Position
pub fn increase_attempted(&mut self)
pub fn decrease_attempted(&mut self)
pub fn increase_passed(&mut self)
pub fn decrease_passed(&mut self)
pub fn success_rate(&self) -> f64
Trait Implementations§
impl StructuralPartialEq for Maze
Auto Trait Implementations§
impl Freeze for Maze
impl RefUnwindSafe for Maze
impl Send for Maze
impl Sync for Maze
impl Unpin for Maze
impl UnsafeUnpin for Maze
impl UnwindSafe for Maze
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more