check, if the tile is inside grid and if it is set as walkable
345576
def walkable(self, x, y):
        
        return self.inside(x, y) and self.nodes[y][x].walkable
429945
private boolean isTermTrackBreadth(Term t) {
        if (t instanceof TermLengthOrPercent) {
            return true;
        } else if (t instanceof TermIdent) {
            CSSProperty property = genericPropertyRaw(GridTemplateRowsColumns.class, null, (TermIdent) t);
            return property == GridTemplateRowsColumns.AUTO
                    || property == GridTemplateRowsColumns.MIN_CONTENT
                    || property == GridTemplateRowsColumns.MAX_CONTENT;
        }
        return false;
    }
174969
private void checkTransitives(Tile tile, int tx, int ty)
    {
        final Tile neighbor = map.getTile(tx, ty);
        final String group = mapGroup.getGroup(neighbor);
        if (neighbor != null)
        {
            for (final GroupTransition current : getTransitives(mapGroup.getGroup(tile), mapGroup.getGroup(neighbor)))
            {
                for (final TileRef ref : mapGroup.getGroup(current.getOut()))
                {
                    checkTransitives(neighbor, group, current, ref);
                }
                break;
            }
        }
    }
551781
def _parent_tile(tiles):
    
    parent = None
    for t in tiles:
        if parent is None:
            parent = t

        else:
            parent = common_parent(parent, t)

    return parent
713556
private void updateTransitiveTile(Tile tile)
    {
        final Circuit circuit = extractor.getCircuit(tile);
        if (circuit == null || !circuits.containsKey(circuit))
        {
            final String group = getTransitiveGroup(circuit, tile);
            if (group != null)
            {
                final TileRef ref = mapTransition.getTiles(new Transition(TransitionType.CENTER, group, group))
                                                 .iterator()
                                                 .next();
                final Tile newTile = map.createTile(ref.getSheet(), ref.getNumber(), tile.getX(), tile.getY());
                map.setTile(newTile);
                mapTransition.resolve(newTile);
                map.setTile(tile);
            }
        }
    }
1132905
public boolean has(String tableName) {

		boolean exists = has(EXTENSION_NAME, tableName,
				TileTable.COLUMN_TILE_DATA);

		return exists;
	}
423471
def bounds(ctx, tile):
    """"""
    click.echo(
        '%s %s %s %s' % TilePyramid(
            ctx.obj['grid'],
            tile_size=ctx.obj['tile_size'],
            metatiling=ctx.obj['metatiling']
        ).tile(*tile).bounds(pixelbuffer=ctx.obj['pixelbuffer'])
    )
566766
function(){
            var tiles = [];
            if(this.limitToFov){
                var fovTiles = this.limitToFov.visibleTiles;
                for (var i = 0; i < fovTiles.length; i++) {
                    var fovTile = fovTiles[i];
                    // if no max range, if there is a max range check it
                    if(!this.range || fovTile.range <= this.range){

                        // if including tile objects in result but not preparing them
                        if(this.includeTiles && !this.prepareValidTargets){
                            fovTile = fovTile.value;
                        }
                        tiles.push(fovTile);
                    }
                }
            } else {
                var x = this.x,
                    y = this.y;

                if(this.range === 1){
                    if(this.limitToNonDiagonalAdjacent){
                        tiles = this.game.map.getAdjacent(x, y, {withDiagonals: false});
                    }
                    else{
                        tiles = this.game.map.getAdjacent(x, y);
                    }
                } else {
                    tiles = this.game.map.getWithinSquareRadius(x, y, {radius: this.range});
                }

                // if including tile objects, prepare them
                if(this.includeTiles && this.prepareValidTargets){
                    var _this = this;
                    tiles = tiles.map(function(tile){
                        return _this.prepareTargetObject(tile);
                    });
                }
            }
            return tiles;
        }
848165
function gli_window_grid_canonicalize(win) {
    if (win.cursorx < 0)
        win.cursorx = 0;
    else if (win.cursorx >= win.gridwidth) {
        win.cursorx = 0;
        win.cursory++;
    }
    if (win.cursory < 0)
        win.cursory = 0;
    else if (win.cursory >= win.gridheight)
        return true; /* outside the window */
    return false;
}
1210302
boolean ensureCCW( SquareGrid grid ) {
		if( grid.columns <= 2 && grid.rows <= 2 )
			return true;

		Point2D_F64 a,b,c;

		a = grid.get(0,0).center;
		if( grid.columns > 2)
			b = grid.get(0,2).center;
		else
			b = grid.get(1,1).center;

		if( grid.rows > 2)
			c = grid.get(2,0).center;
		else
			c = grid.get(1,1).center;

		double x0 = b.x-a.x;
		double y0 = b.y-a.y;

		double x1 = c.x-a.x;
		double y1 = c.y-a.y;

		double z = x0 * y1 - y0 * x1;
		if( z < 0 ) {
			// flip it along an axis which is symmetric
			if( grid.columns%2 == 1 )
				tools.flipColumns(grid);
			else if( grid.rows%2 == 1 )
				tools.flipRows(grid);
			else
				return false;
		}
		return true;
	}
993321
public static TileGrid getTileGrid(BoundingBox totalBox, long matrixWidth,
			long matrixHeight, BoundingBox boundingBox) {

		long minColumn = getTileColumn(totalBox, matrixWidth,
				boundingBox.getMinLongitude());
		long maxColumn = getTileColumn(totalBox, matrixWidth,
				boundingBox.getMaxLongitude());

		if (minColumn < matrixWidth && maxColumn >= 0) {
			if (minColumn < 0) {
				minColumn = 0;
			}
			if (maxColumn >= matrixWidth) {
				maxColumn = matrixWidth - 1;
			}
		}

		long maxRow = getTileRow(totalBox, matrixHeight,
				boundingBox.getMinLatitude());
		long minRow = getTileRow(totalBox, matrixHeight,
				boundingBox.getMaxLatitude());

		if (minRow < matrixHeight && maxRow >= 0) {
			if (minRow < 0) {
				minRow = 0;
			}
			if (maxRow >= matrixHeight) {
				maxRow = matrixHeight - 1;
			}
		}

		TileGrid tileGrid = new TileGrid(minColumn, minRow, maxColumn, maxRow);

		return tileGrid;
	}
1257564
def is_full(self):
        
        if len(self.grid) == 0:
            return False

        for i in range(len(self.grid)):
            for j in range(len(self.grid[0])):
                if self.grid[i][j] is None:
                    return False
        return True
542958
function compareTiles( previousBest, tile ) {
    if ( !previousBest ) {
        return tile;
    }

    if ( tile.visibility > previousBest.visibility ) {
        return tile;
    } else if ( tile.visibility == previousBest.visibility ) {
        if ( tile.squaredDistance < previousBest.squaredDistance ) {
            return tile;
        }
    }

    return previousBest;
}
399779
function GridTileAnimator(grid, tiles) {
    grid.element.css(grid.style);
    tiles.forEach(function(t) {
      t.element.css(t.style);
    });
  }
1097381
def _tiles_from_cleaned_bounds(tp, bounds, zoom):
    """"""
    lb = _tile_from_xy(tp, bounds.left, bounds.bottom, zoom, on_edge_use="rt")
    rt = _tile_from_xy(tp, bounds.right, bounds.top, zoom, on_edge_use="lb")
    for tile_id in product([zoom], range(rt.row, lb.row + 1), range(lb.col, rt.col + 1)):
        yield tp.tile(*tile_id)
136678
private int countTiles(int widthInTile, int step, int s)
    {
        int count = 0;
        for (int tx = 0; tx < widthInTile; tx++)
        {
            for (int ty = 0; ty < map.getInTileHeight(); ty++)
            {
                if (map.getTile(tx + s * step, ty) != null)
                {
                    count++;
                }
            }
        }
        return count;
    }
933754
private boolean isCenter(Tile tile)
    {
        for (final Transition transition : tiles.get(new TileRef(tile)))
        {
            if (TransitionType.CENTER == transition.getType())
            {
                return true;
            }
        }
        return false;
    }