use of com.b3dgs.lionengine.game.feature.tile.map.transition.Transition in project lionengine by b3dgs.
the class MapTileCircuitModel method updateTransitiveTile.
/**
* Update tile.
*
* @param tile The tile reference.
*/
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 int old = tile.getNumber();
final Integer ref = mapTransition.getTiles(new Transition(TransitionType.CENTER, group, group)).iterator().next();
final Tile newTile = new TileGame(ref.intValue(), tile.getInTileX(), tile.getInTileY(), tile.getWidth(), tile.getHeight());
map.setTile(newTile.getInTileX(), newTile.getInTileY(), newTile.getNumber());
mapTransition.resolve(newTile);
map.setTile(newTile.getInTileX(), newTile.getInTileY(), old);
}
}
}
Aggregations