TileSetItem.fromJson constructor

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

Implementation

TileSetItem.fromJson(Map<String, dynamic> json) {
  id = json['id'];
  type = json['type'];
  image = json['image'];
  imageHeight = json['imageheight'];
  imageWidth = json['imagewidth'];
  probability = json['probability'];
  if (json['terrain'] != null) {
    terrain = <int>[];
    json['terrain'].forEach((v) {
      terrain?.add(v);
    });
  }
  objectGroup = json['objectgroup'] != null
      ? new TileSetObjectGroup.fromJson(json['objectgroup'])
      : null;
  if (json['animation'] != null) {
    animation = <FrameAnimation>[];
    json['animation'].forEach((v) {
      animation?.add(new FrameAnimation.fromJson(v));
    });
  }
  if (json['properties'] != null) {
    properties = <Property>[];
    json['properties'].forEach((v) {
      properties?.add(new Property.fromJson(v));
    });
  }
}