TileSetDetail.fromJson constructor

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

Implementation

TileSetDetail.fromJson(Map<String, dynamic> json) {
  firsTgId = json['firstgid'];
  source = json['source'];
  backgroundColor = json['backgroundcolor'];
  columns = json['columns'];
  image = json['image'];
  imageHeight = json['imageheight'];
  imageWidth = json['imagewidth'];
  margin = json['margin'];
  name = json['name'];
  objectAlignment = json['objectalignment'];
  spacing = json['spacing'];
  tileCount = json['tilecount'];
  tiledVersion = json['tiledversion'];
  tileHeight = json['tileheight'];
  tileWidth = json['tilewidth'];
  transparentColor = json['transparentcolor'];
  version = double.tryParse(json['version'].toString()) ?? 0.0;
  type = json['type'];
  if (json['tileSet'] != null) tileSet = TileSet.fromJson(json['tileSet']);
  if (json['properties'] != null) {
    properties = <Property>[];
    json['properties'].forEach((v) {
      properties?.add(new Property.fromJson(v));
    });
  }
  if (json['terrains'] != null) {
    terrains = [];
    json['terrains'].forEach((v) {
      terrains?.add(v);
    });
  }
  if (json['wangsets'] != null) {
    wangSets = [];
    json['wangsets'].forEach((v) {
      wangSets?.add(WangSet.fromJson(v));
    });
  }
}