Check transitive tiles.

@param tile The tile reference.
@param tx The horizontal index neighbor.
@param ty The vertical index neighbor.
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;
            }
        }
    }
79412
public static List<Toitsu> findJantoCandidate(int[] tiles) throws MahjongTileOverFlowException {
        List<Toitsu> result = new ArrayList<>(7);
        for (int i = 0; i < tiles.length; i++) {
            if (tiles[i] > 4) {
                throw new MahjongTileOverFlowException(i, tiles[i]);
            }
            if (tiles[i] >= 2) {
                result.add(new Toitsu(Tile.valueOf(i)));
            }
        }
        return result;
    }
1160173
public void setTileId(int x, int y, int layerIndex, int tileid) {
		Layer layer = (Layer) layers.get(layerIndex);
		layer.setTileID(x, y, tileid);
	}
1170212
public static boolean check(Tile tile1, Tile tile2, Tile tile3, Tile tile4) {
        return tile1 == tile2 && tile2 == tile3 && tile3 == tile4;
    }
1014300
public boolean hasTile(int x, int y, int zoom) {

        // Check if generating tiles for the zoom level and is within the bounding box
        boolean hasTile = isWithinBounds(x, y, zoom);
        if (hasTile) {
            // Check if there is a tile to retrieve
            hasTile = hasTileToRetrieve(x, y, zoom);
        }

        return hasTile;
    }
1325654
private boolean checkConstraint(Collection<String> constraints, Tile tile)
    {
        return tile != null
               && constraints.contains(mapGroup.getGroup(tile))
               && !tile.getFeature(TileCollision.class).getCollisionFormulas().isEmpty();
    }
841479
protected boolean checkTileIndex (int tileIndex)
    {
        int tcount = getTileCount();
        if (tileIndex >= 0 && tileIndex < tcount) {
            return true;
        } else {
            log.warning("Requested invalid tile [tset=" + this + ", index=" + tileIndex + "].",
                        new Exception());
            return false;
        }
    }
933754
private boolean isCenter(Tile tile)
    {
        for (final Transition transition : tiles.get(new TileRef(tile)))
        {
            if (TransitionType.CENTER == transition.getType())
            {
                return true;
            }
        }
        return false;
    }
118955
private void updateTransitive(Collection<Tile> resolved, Tile tile, Tile neighbor, GroupTransition transitive)
    {
        final String transitiveOut = transitive.getOut();
        final Transition transition = new Transition(TransitionType.CENTER, transitiveOut, transitiveOut);
        final Collection<TileRef> refs = getTiles(transition);
        if (!refs.isEmpty())
        {
            final TileRef ref = refs.iterator().next();

            // Replace user tile with the needed tile to solve transition (restored later)
            final Tile newTile = map.createTile(ref.getSheet(), ref.getNumber(), tile.getX(), tile.getY());
            map.setTile(newTile);

            // Replace neighbor with the needed tile to solve transition
            final Tile newTile2 = map.createTile(ref.getSheet(), ref.getNumber(), neighbor.getX(), neighbor.getY());
            map.setTile(newTile2);
            resolved.addAll(resolve(newTile2));
        }
    }
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);
            }
        }
    }
28318
public void setTile(int x, int y, String tile) {
        if ((x > getArrayWidth()) || (y > getArrayHeight()) || (x < 0) || (y < 0)) {
            throw new IllegalArgumentException();
        }
        image[x][y] = tile;
    }
670653
private static void checkTransitionGroups(Map<Circuit, Collection<TileRef>> circuits,
                                              Circuit circuit,
                                              MapTile map,
                                              TileRef ref)
    {
        final MapTileGroup mapGroup = map.getFeature(MapTileGroup.class);
        final MapTileTransition mapTransition = map.getFeature(MapTileTransition.class);
        final String group = mapGroup.getGroup(ref);
        for (final String groupTransition : mapGroup.getGroups())
        {
            if (mapTransition.getTransitives(group, groupTransition).size() == 1)
            {
                final Circuit transitiveCircuit = new Circuit(circuit.getType(), group, groupTransition);
                getTiles(circuits, transitiveCircuit).add(ref);
            }
        }
    }
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;
    }
566905
public boolean contains(T transaction, I item) {
		int t = transactionToIndex(transaction);
		if (t < 0)
			return false;
		int i = itemToIndex(item);
		if (i < 0)
			return false;
		return matrix.contains(t, i);
	}
389245
private void renderTile(Graphic g, int tx, int ty, double viewX, double viewY)
    {
        final Tile tile = map.getTile(tx, ty);
        if (tile != null)
        {
            final int x = (int) Math.floor(tile.getX() - viewX);
            final int y = (int) Math.floor(-tile.getY() + viewY - tile.getHeight());

            for (final MapTileRenderer renderer : renderers)
            {
                renderer.renderTile(g, map, tile, x, y);
            }
        }
    }
798730
@Override
    public void renderTile(Graphic g, MapTile map, Tile tile, int x, int y)
    {
        final SpriteTiled sprite = map.getSheet(tile.getSheet());
        sprite.setLocation(x, y);
        sprite.setTile(tile.getNumber());
        sprite.render(g);
    }
1015735
function hasSiblings(tile, tiles) {
    var siblings = getSiblings(tile);
    for (var i = 0; i < siblings.length; i++) {
        if (!hasTile(tiles, siblings[i])) return false;
    }
    return true;
}