TileSet.fromJson constructor

TileSet.fromJson(
  1. Map<String, dynamic> json
)

Implementation

TileSet.fromJson(Map<String, dynamic> json) {
  columns = json['columns'];
  image = json['image'];
  imageHeight = double.parse(json['imageheight'].toString());
  imageWidth = double.parse(json['imagewidth'].toString());
  margin = double.parse(json['margin'].toString());
  name = json['name'];
  spacing = double.parse(json['spacing'].toString());
  tileCount = json['tilecount'];
  tiledVersion = json['tiledversion'];
  tileHeight = double.parse(json['tileheight'].toString());
  if (json['tiles'] != null) {
    tiles = <TileSetItem>[];
    json['tiles'].forEach((v) {
      tiles?.add(new TileSetItem.fromJson(v));
    });
  }
  tileWidth = double.parse(json['tilewidth'].toString());
  type = json['type'];
  version = double.tryParse(json['version'].toString()) ?? 0.0;
}