[−][src]Enum sweeper::Tile
A Minesweeper tile.
Variants
ClosedEmpty(Flag)
A tile which is empty but hasn't been opened yet.
A tile which has been opened and doesn't have neighboring mines.
OpenNumber(NonZeroU8)
A tile which has been opened and has neighboring mines.
Mine(Flag)
A tile which has a mine inside, and whether it's marked or not.
Methods
impl Tile
[src]
pub fn is_closed(self) -> bool
[src]
Returns true
if the tile is closed, false
otherwise.
pub fn is_open(self) -> bool
[src]
Returns true
if the tile is open, false
otherwise.
pub fn is_mine(self) -> bool
[src]
Returns true
if the tile contains a mine, false
otherwise.
pub fn is_safe(self) -> bool
[src]
Returns true
if clicking this tile does not end the game, false
otherwise.
pub fn is_required_to_open(self) -> bool
[src]
Returns true
if this tile has to be clicked in order for the game to successfully end, false
otherwise.
This is false
for open mines — returns true
only for ClosedEmpty
.
pub fn flag_state(self) -> Option<Flag>
[src]
Returns the type of flag installed on this tile, or None
if this tile is open and thus cannot hold a flag.
pub fn is_flagged(self) -> bool
[src]
Returns true
if the flag_state
is Some(Flag::Flagged)
, false
otherwise.
pub fn peek_local(self) -> Option<ClickOutcome>
[src]
Returns a ClickOutcome
from the data known only to this specific tile, or None
if returning one requires access to the field.
Trait Implementations
impl Clone for Tile
[src]
impl Copy for Tile
[src]
impl Debug for Tile
[src]
impl Default for Tile
[src]
impl<'de> Deserialize<'de> for Tile
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Tile
[src]
impl PartialEq<Tile> for Tile
[src]
fn eq(&self, other: &Self) -> bool
[src]
Compares two tiles.
Two tiles are equal if they're both empty or they both contain a mine. Other factors, like the presence of a flag or amount of surrounding mines are not compared.
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for Tile
[src]
Auto Trait Implementations
impl RefUnwindSafe for Tile
impl Send for Tile
impl Sync for Tile
impl Unpin for Tile
impl UnwindSafe for Tile
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,