use of com.b3dgs.lionengine.game.feature.tile.map.MapTile in project lionengine by b3dgs.
the class TransitionsExtractorImpl method getTransitions.
/*
* TransitionsExtractor
*/
@Override
public Map<Transition, Collection<Integer>> getTransitions(Collection<Media> levels, Media sheetsConfig, Media groupsConfig) {
final Collection<MapTile> mapsSet = new HashSet<>(levels.size());
for (final Media level : levels) {
final MapTileGame map = new MapTileGame();
map.create(level, sheetsConfig);
final MapTileGroup mapGroup = new MapTileGroupModel();
mapGroup.loadGroups(groupsConfig);
map.addFeature(mapGroup);
mapsSet.add(map);
}
return getTransitions(mapsSet);
}
use of com.b3dgs.lionengine.game.feature.tile.map.MapTile in project lionengine by b3dgs.
the class TransitionsExtractorImpl method getTransitions.
/**
* Get map tile transitions.
*
* @param map The map reference.
* @return The transitions found with their associated tiles.
*/
private static Map<Transition, Collection<Integer>> getTransitions(MapTile map) {
final Map<Transition, Collection<Integer>> transitions = new HashMap<>();
final MapTransitionExtractor extractor = new MapTransitionExtractor(map);
for (int ty = 1; ty < map.getInTileHeight() - 1; ty++) {
for (int tx = 1; tx < map.getInTileWidth() - 1; tx++) {
final Tile tile = map.getTile(tx, ty);
if (tile != null) {
checkTransition(transitions, extractor, tile);
}
}
}
return transitions;
}
use of com.b3dgs.lionengine.game.feature.tile.map.MapTile in project lionengine by b3dgs.
the class CircuitsExtractorImpl method getCircuits.
/*
* CircuitsExtractor
*/
@Override
public Map<Circuit, Collection<Integer>> getCircuits(Collection<Media> levels, Media sheetsConfig, Media groupsConfig) {
final Collection<MapTile> mapsSet = new HashSet<>(levels.size());
for (final Media level : levels) {
final MapTileGame map = new MapTileGame();
map.create(level, sheetsConfig);
final MapTileGroup mapGroup = map.addFeatureAndGet(new MapTileGroupModel());
final MapTileTransition mapTransition = map.addFeatureAndGet(new MapTileTransitionModel());
mapGroup.loadGroups(groupsConfig);
mapTransition.loadTransitions(levels, sheetsConfig, groupsConfig);
mapsSet.add(map);
}
return getCircuits(mapsSet);
}
Aggregations