def tile_id_in_direction(from_tile_id, direction):
    """
    Variant on direction_to_tile. Returns None if there's no tile there.

    :param from_tile_id: tile identifier, int
    :param direction: str
    :return: tile identifier, int or None
    """
    coord_from = tile_id_to_coord(from_tile_id)
    for offset, dirn in _tile_tile_offsets.items():
        if dirn == direction:
            coord_to = coord_from + offset
            if coord_to in legal_tile_coords():
                return tile_id_from_coord(coord_to)
    return None
Variant on direction_to_tile. Returns None if there's no tile there.

    :param from_tile_id: tile identifier, int
    :param direction: str
    :return: tile identifier, int or None