Search in sources :

Example 1 with MapFile

use of org.apollo.cache.map.MapFile in project apollo by apollo-rsps.

the class WorldMapDecoder method run.

/**
 * Decode all {@link MapFile}s and notify the {@link CollisionManager} of any tiles that are
 * flagged as blocked or on a bridge.
 */
@Override
public void run() {
    Map<Integer, MapIndex> mapIndices = MapIndex.getIndices();
    try {
        for (MapIndex index : mapIndices.values()) {
            MapFileDecoder decoder = MapFileDecoder.create(fs, index);
            MapFile mapFile = decoder.decode();
            MapPlane[] mapPlanes = mapFile.getPlanes();
            int mapX = index.getX(), mapY = index.getY();
            for (MapPlane plane : mapPlanes) {
                markTiles(mapX, mapY, plane);
            }
        }
    } catch (IOException ex) {
        throw new UncheckedIOException(ex);
    }
}
Also used : MapFileDecoder(org.apollo.cache.map.MapFileDecoder) MapFile(org.apollo.cache.map.MapFile) UncheckedIOException(java.io.UncheckedIOException) MapIndex(org.apollo.cache.map.MapIndex) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) MapPlane(org.apollo.cache.map.MapPlane)

Aggregations

IOException (java.io.IOException)1 UncheckedIOException (java.io.UncheckedIOException)1 MapFile (org.apollo.cache.map.MapFile)1 MapFileDecoder (org.apollo.cache.map.MapFileDecoder)1 MapIndex (org.apollo.cache.map.MapIndex)1 MapPlane (org.apollo.cache.map.MapPlane)1