fromNetwork<T> static method

WorldMapReader<T> fromNetwork<T>(
  1. Uri uri, {
  2. TiledCacheProvider? cacheProvider,
  3. Map<String, String>? headers,
})

Implementation

static WorldMapReader<T> fromNetwork<T>(
  Uri uri, {
  TiledCacheProvider? cacheProvider,
  Map<String, String>? headers,
}) {
  switch (T) {
    case TiledMap:
      return TiledNetworkReader(
        uri: uri,
        cacheProvider: cacheProvider,
        headers: headers,
      ) as WorldMapReader<T>;
    case SpritefusionMap:
      return SpritefusionNetworkReader(
        uri: uri,
        cacheProvider: cacheProvider,
        headers: headers,
      ) as WorldMapReader<T>;
    default:
      throw Exception('There is not a WorldMapReader.network to $T');
  }
}