SpritefusionMap.fromMap constructor

SpritefusionMap.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory SpritefusionMap.fromMap(Map<String, dynamic> map) {
  return SpritefusionMap(
    tileSize: double.parse(map['tileSize'].toString()),
    mapWidth: double.parse(map['mapWidth'].toString()),
    mapHeight: double.parse(map['mapHeight'].toString()),
    imgPath: map['imgPath'] ?? '',
    layers: List<SpritefusionMapLayer>.from(
      (map['layers'] as List).map<SpritefusionMapLayer>(
        (x) => SpritefusionMapLayer.fromMap(x as Map<String, dynamic>),
      ),
    ),
  );
}