fn location(&self, tile: Tile) -> Option<(u32, u32)> {
        match tile {
            Tile::Floor => Some((0, 0)),
            Tile::Wall => Some((0, 2)),
            Tile::Rock => Some((2, 0)),
            Tile::Square => Some((1, 0)),
            Tile::Player => Some((3, 0)),
            Tile::Shadow(N_EDGE) => Some((4, 0)),
            Tile::Shadow(S_EDGE) => Some((5, 0)),
            Tile::Shadow(E_EDGE) => Some((0, 1)),
            Tile::Shadow(W_EDGE) => Some((1, 1)),
            Tile::Shadow(NE_CORNER) => Some((2, 1)),
            Tile::Shadow(NW_CORNER) => Some((3, 1)),
            Tile::Shadow(SE_CORNER) => Some((4, 1)),
            Tile::Shadow(SW_CORNER) => Some((5, 1)),
            Tile::Shadow(ShadowFlags { .. }) => None,
        }
    }
/// Returns the location of the tile in the tileset texture.
Returns the location of the tile in the tileset texture.
Returns the location of the tile in the tileset texture .
fn location(&self, tile: Tile) -> Option<(u32, u32)> {
        match tile {
            Tile::Floor => Some((0, 0)),
            Tile::Wall => Some((0, 2)),
            Tile::Rock => Some((2, 0)),
            Tile::Square => Some((1, 0)),
            Tile::Player => Some((3, 0)),
            Tile::Shadow(N_EDGE) => Some((4, 0)),
            Tile::Shadow(S_EDGE) => Some((5, 0)),
            Tile::Shadow(E_EDGE) => Some((0, 1)),
            Tile::Shadow(W_EDGE) => Some((1, 1)),
            Tile::Shadow(NE_CORNER) => Some((2, 1)),
            Tile::Shadow(NW_CORNER) => Some((3, 1)),
            Tile::Shadow(SE_CORNER) => Some((4, 1)),
            Tile::Shadow(SW_CORNER) => Some((5, 1)),
            Tile::Shadow(ShadowFlags { .. }) => None,
        }
    }
fn location ( & self , tile : Tile ) -> Option < ( u32 , u32 ) > { match tile { Tile :: Floor => Some ( ( 0 , 0 ) ) , Tile :: Wall => Some ( ( 0 , 2 ) ) , Tile :: Rock => Some ( ( 2 , 0 ) ) , Tile :: Square => Some ( ( 1 , 0 ) ) , Tile :: Player => Some ( ( 3 , 0 ) ) , Tile :: Shadow ( N_EDGE ) => Some ( ( 4 , 0 ) ) , Tile :: Shadow ( S_EDGE ) => Some ( ( 5 , 0 ) ) , Tile :: Shadow ( E_EDGE ) => Some ( ( 0 , 1 ) ) , Tile :: Shadow ( W_EDGE ) => Some ( ( 1 , 1 ) ) , Tile :: Shadow ( NE_CORNER ) => Some ( ( 2 , 1 ) ) , Tile :: Shadow ( NW_CORNER ) => Some ( ( 3 , 1 ) ) , Tile :: Shadow ( SE_CORNER ) => Some ( ( 4 , 1 ) ) , Tile :: Shadow ( SW_CORNER ) => Some ( ( 5 , 1 ) ) , Tile :: Shadow ( ShadowFlags { .. } ) => None , } }
Returns the location of the tile in the tileset texture.
Returns the location of the tile in the tileset texture .
&self
tile
Tile