struct SingleWarehouse {
walls: HashSet<(usize, usize)>,
boxes: HashSet<(usize, usize)>,
robot: (usize, usize),
bounds: (usize, usize),
}
Expand description
Warehouse implementation of part 1
Fields§
§walls: HashSet<(usize, usize)>
§boxes: HashSet<(usize, usize)>
§robot: (usize, usize)
§bounds: (usize, usize)
Implementations§
source§impl SingleWarehouse
impl SingleWarehouse
fn render(&self)
sourcefn double(&self) -> DoubleWarehouse
fn double(&self) -> DoubleWarehouse
Expand this warehouse into the doubled form used for part 2
Trait Implementations§
source§impl Clone for SingleWarehouse
impl Clone for SingleWarehouse
source§fn clone(&self) -> SingleWarehouse
fn clone(&self) -> SingleWarehouse
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SingleWarehouse
impl Debug for SingleWarehouse
source§impl FromStr for SingleWarehouse
impl FromStr for SingleWarehouse
source§impl PartialEq for SingleWarehouse
impl PartialEq for SingleWarehouse
source§impl Warehouse for SingleWarehouse
impl Warehouse for SingleWarehouse
source§fn move_box(&mut self, pos: &(usize, usize), mv: &Move) -> bool
fn move_box(&mut self, pos: &(usize, usize), mv: &Move) -> bool
Recursively move boxes, changes will only be made if there is space to move all boxes
source§fn move_robot(&self, mv: &Move) -> Self
fn move_robot(&self, mv: &Move) -> Self
Apply a move to the robot in the warehouse, moving boxes if needed. This will be a no-op if the move is blocked by a wall, or any of the box moves are.
impl Eq for SingleWarehouse
impl StructuralPartialEq for SingleWarehouse
Auto Trait Implementations§
impl Freeze for SingleWarehouse
impl RefUnwindSafe for SingleWarehouse
impl Send for SingleWarehouse
impl Sync for SingleWarehouse
impl Unpin for SingleWarehouse
impl UnwindSafe for SingleWarehouse
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.