pub enum MoveError {
Show 14 variants
CantClimb,
GrasshopperBadHop,
Inconsistent,
MissingPiece,
NoFreedomToMove,
NoMovement,
NoValidPath,
NotAdjacentToAnotherPiece,
OneHiveRuleViolation,
SpiderBacktracking,
SpiderNotThreeSpaces,
QueenBeeNotPlaced,
TooLong,
WrongPlayer,
}
Expand description
Errors related to movement and movement checks of placed pieces.
Variants§
CantClimb
The chosen piece can’t climb on top of other pieces.
GrasshopperBadHop
A grasshopper attempted to jump over an empty cell.
Inconsistent
One or more subsequent cells in a movement path aren’t neighbors.
MissingPiece
No piece was found at the beginning of the movement path.
NoFreedomToMove
The chosen piece doesn’t have the Freedom to Move on the given path.
NoMovement
The movement path results in the piece not changing its position.
NoValidPath
There is no valid path that can move the given piece to the chosen position.
NotAdjacentToAnotherPiece
One or more cells in a movement path aren’t adjacent to any existing piece.
OneHiveRuleViolation
The given movement path would violate the One Hive Rule.
SpiderBacktracking
A spider attempted to backtrack in its movement path.
SpiderNotThreeSpaces
A spider attempted to move more or less than 3 cells at once.
QueenBeeNotPlaced
A player attempted to move a placed piece without having placed their queen bee.
TooLong
The given movement path is too long for the chosen piece.
WrongPlayer
A player attempted to move a piece belonging to their opponent.
Trait Implementations§
impl Eq for MoveError
impl StructuralPartialEq for MoveError
Auto Trait Implementations§
impl Freeze for MoveError
impl RefUnwindSafe for MoveError
impl Send for MoveError
impl Sync for MoveError
impl Unpin for MoveError
impl UnwindSafe for MoveError
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
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>
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>
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