diff --git a/packages/tiled/lib/src/chunk.dart b/packages/tiled/lib/src/chunk.dart index bab4331..b9cbd8a 100644 --- a/packages/tiled/lib/src/chunk.dart +++ b/packages/tiled/lib/src/chunk.dart @@ -61,7 +61,7 @@ class Chunk extends Exportable { } @override - ExportElement export(ExportSettings settings) { + ExportElement export({FileEncoding? encoding, Compression? compression}) { final common = { 'x': x.toExport(), 'y': y.toExport(), @@ -73,7 +73,11 @@ class Chunk extends Exportable { 'chunk', common, { - 'data': TileData(data).export(settings), + 'data': TileDataEncoder( + data: data, + compression: compression, + encoding: encoding, + ).export(), }, ); } diff --git a/packages/tiled/lib/src/common/frame.dart b/packages/tiled/lib/src/common/frame.dart index a543eca..f9ad1b8 100644 --- a/packages/tiled/lib/src/common/frame.dart +++ b/packages/tiled/lib/src/common/frame.dart @@ -24,7 +24,7 @@ class Frame extends Exportable { ); @override - ExportResolver export(ExportSettings settings) => ExportElement('frame', { + ExportResolver export() => ExportElement('frame', { 'tileid': tileId.toExport(), 'duration': duration.toExport(), }, {}); diff --git a/packages/tiled/lib/src/common/gid.dart b/packages/tiled/lib/src/common/gid.dart index 1d32817..04e47e2 100644 --- a/packages/tiled/lib/src/common/gid.dart +++ b/packages/tiled/lib/src/common/gid.dart @@ -32,7 +32,7 @@ part of tiled; /// When rendering a tile, the order of operation matters. The diagonal flip /// (x/y axis swap) is done first, followed by the horizontal and vertical /// flips. -class Gid extends ExportValue { +class Gid extends ExportValue { static const int flippedHorizontallyFlag = 0x80000000; static const int flippedVerticallyFlag = 0x40000000; static const int flippedDiagonallyFlag = 0x20000000; @@ -83,16 +83,16 @@ class Gid extends ExportValue { }); } - String export() => ((tile & ~flagBits) | - (flips.horizontally ? flippedHorizontallyFlag : 0) | - (flips.vertically ? flippedVerticallyFlag : 0) | - (flips.diagonally ? flippedDiagonallyFlag : 0) | - (flips.antiDiagonally ? flippedAntiDiagonallyFlag : 0)) - .toString(); + int export() => + (tile & ~flagBits) | + (flips.horizontally ? flippedHorizontallyFlag : 0) | + (flips.vertically ? flippedVerticallyFlag : 0) | + (flips.diagonally ? flippedDiagonallyFlag : 0) | + (flips.antiDiagonally ? flippedAntiDiagonallyFlag : 0); @override - String get json => export(); + int get json => export(); @override - String get xml => export(); + String get xml => export().toString(); } diff --git a/packages/tiled/lib/src/common/property.dart b/packages/tiled/lib/src/common/property.dart index 58b9cbe..6262241 100644 --- a/packages/tiled/lib/src/common/property.dart +++ b/packages/tiled/lib/src/common/property.dart @@ -12,7 +12,7 @@ part of tiled; /// (default string is “”, default number is 0, default boolean is “false”, /// default color is #00000000, default file is “.” (the current file’s /// parent directory)) -class Property { +class Property with Exportable { String name; PropertyType type; T value; diff --git a/packages/tiled/lib/src/common/tiled_image.dart b/packages/tiled/lib/src/common/tiled_image.dart index 1946192..eef2db2 100644 --- a/packages/tiled/lib/src/common/tiled_image.dart +++ b/packages/tiled/lib/src/common/tiled_image.dart @@ -55,7 +55,7 @@ class TiledImage with Exportable { int get hashCode => source.hashCode; @override - ExportElement export(ExportSettings settings) => ExportElement( + ExportElement export() => ExportElement( 'image', { 'width': width?.toExport(), diff --git a/packages/tiled/lib/src/data.dart b/packages/tiled/lib/src/data.dart index 0b2e6cd..5611238 100644 --- a/packages/tiled/lib/src/data.dart +++ b/packages/tiled/lib/src/data.dart @@ -1,28 +1,33 @@ part of tiled; -class TileData extends DelegatingList with Exportable { - TileData(super.base); +class TileDataEncoder extends DelegatingList with Exportable { + final FileEncoding? encoding; + final Compression? compression; + + TileDataEncoder({ + required List data, + required this.encoding, + required this.compression, + }) : super(data); @override - ExportResolver export(ExportSettings settings) { + ExportResolver export() { String? data; - switch (settings.encoding) { + switch (encoding) { case null: break; case FileEncoding.csv: data = join(', '); break; case FileEncoding.base64: - data = _base64(settings); + data = _base64(); break; } return ExportFormatSpecific( xml: ExportElement('data', { - if (settings.encoding != null) - 'encoding': settings.encoding!.name.toExport(), - if (settings.compression != null) - 'compression': settings.compression!.name.toExport(), + if (encoding != null) 'encoding': encoding!.name.toExport(), + if (compression != null) 'compression': compression!.name.toExport(), }, { if (data == null) 'tiles': ExportList(map( @@ -39,7 +44,7 @@ class TileData extends DelegatingList with Exportable { ); } - String _base64(ExportSettings settings) { + String _base64() { // Conversion to Uint8List final uint32 = Uint32List.fromList(this); final dv = ByteData(this.length * 4); @@ -52,8 +57,8 @@ class TileData extends DelegatingList with Exportable { // Compression List compressed; - print(settings.compression); - switch (settings.compression) { + print(compression); + switch (compression) { case Compression.zlib: compressed = const ZLibEncoder().encode(uint8); break; diff --git a/packages/tiled/lib/src/exporter/export_element.dart b/packages/tiled/lib/src/exporter/export_element.dart index ade0e9b..d09705b 100644 --- a/packages/tiled/lib/src/exporter/export_element.dart +++ b/packages/tiled/lib/src/exporter/export_element.dart @@ -5,7 +5,7 @@ abstract class ExportObject {} abstract class ExportResolver implements ExportObject { XmlNode exportXml(); - dynamic exportJson(); + JsonObject exportJson(); } class ExportElement implements ExportResolver { @@ -49,34 +49,34 @@ class ExportElement implements ExportResolver { } @override - Map exportJson() => { - ...fields.map( - (key, value) => MapEntry(key, value.json), + JsonMap exportJson() => JsonMap({ + ...fields.map( + (key, value) => MapEntry(key, value.exportJson()), ), - ...children.map((key, e) { + ...children.map((key, e) { if (e is ExportList) { - return MapEntry>( + return MapEntry( key, - e.map((e) => e.exportJson()).toList(), + JsonList(e.map((e) => e.exportJson())), ); } else if (e is ExportResolver) { - return MapEntry(key, e.exportJson()); + return MapEntry(key, e.exportJson()); } else { throw 'Bad State: ExportChild switch should have been exhaustive'; } }), - 'properties': properties.map((e) => e.export().exportJson()).toList(), - }; + 'properties': JsonList(properties.map((e) => e.exportJson())), + }); } class ExportDirect implements ExportResolver { final XmlElement xml; - final dynamic json; + final JsonObject json; ExportDirect({required this.xml, required this.json}); @override - dynamic exportJson() => json; + JsonObject exportJson() => json; @override XmlElement exportXml() => xml; @@ -89,7 +89,7 @@ class ExportFormatSpecific implements ExportResolver { ExportFormatSpecific({required this.xml, required this.json}); @override - dynamic exportJson() => json.exportJson(); + JsonObject exportJson() => json.exportJson(); @override XmlNode exportXml() => xml.exportXml(); @@ -99,6 +99,6 @@ class ExportList extends DelegatingList implements ExportObject { ExportList(Iterable base) : super(base.toList()); - ExportList.from(Iterable source, ExportSettings settings) - : super(source.map((e) => e.export(settings)).toList()); + ExportList.from(Iterable source) + : super(source.map((e) => e.export()).toList()); } diff --git a/packages/tiled/lib/src/exporter/export_settings.dart b/packages/tiled/lib/src/exporter/export_settings.dart deleted file mode 100644 index 325c141..0000000 --- a/packages/tiled/lib/src/exporter/export_settings.dart +++ /dev/null @@ -1,15 +0,0 @@ -part of tiled; - -class ExportSettings { - final FileEncoding? encoding; - final Compression? compression; - - ExportSettings({ - required this.encoding, - required this.compression, - }) { - if (compression != null) { - assert(encoding == FileEncoding.base64); - } - } -} diff --git a/packages/tiled/lib/src/exporter/export_value.dart b/packages/tiled/lib/src/exporter/export_value.dart index 4d681aa..7602367 100644 --- a/packages/tiled/lib/src/exporter/export_value.dart +++ b/packages/tiled/lib/src/exporter/export_value.dart @@ -1,19 +1,19 @@ part of tiled; -abstract class ExportValue implements ExportObject, ExportResolver { +abstract class ExportValue implements ExportObject, ExportResolver { const ExportValue(); String get xml; - dynamic get json; + T get json; @override XmlNode exportXml() => XmlText(xml); @override - dynamic exportJson() => json; + JsonValue exportJson() => JsonValue(json); } -class ExportLiteral extends ExportValue { +class ExportLiteral extends ExportValue { final T value; const ExportLiteral(this.value); @@ -33,7 +33,7 @@ extension ExportableNum on num { ExportValue toExport() => ExportLiteral(this); } -class _ExportableBool extends ExportValue { +class _ExportableBool extends ExportValue { final bool value; _ExportableBool(this.value); @@ -49,7 +49,7 @@ extension ExportableBool on bool { ExportValue toExport() => _ExportableBool(this); } -class _ExportableColor extends ExportValue { +class _ExportableColor extends ExportValue { final Color color; const _ExportableColor(this.color); @@ -72,16 +72,16 @@ extension ExportableColor on Color { ExportValue toExport() => _ExportableColor(this); } -class _ExportablePointList extends ExportValue { +class _ExportablePointList extends ExportValue>> { final List points; _ExportablePointList(this.points); @override - Iterable> get json => points.map((e) => { + List> get json => points.map((e) => { 'x': e.x, 'y': e.y, - }); + }).toList(); @override String get xml => points.map((e) => '${e.x},${e.y}').join(' '); diff --git a/packages/tiled/lib/src/exporter/exportable.dart b/packages/tiled/lib/src/exporter/exportable.dart index be1f179..56ebc3d 100644 --- a/packages/tiled/lib/src/exporter/exportable.dart +++ b/packages/tiled/lib/src/exporter/exportable.dart @@ -1,8 +1,8 @@ part of tiled; abstract class Exportable { - ExportResolver export(ExportSettings settings); + ExportResolver export(); - XmlNode exportXml(ExportSettings settings) => export(settings).exportXml(); - dynamic exportJson(ExportSettings settings) => export(settings).exportJson(); + XmlNode exportXml() => export().exportXml(); + JsonObject exportJson() => export().exportJson(); } diff --git a/packages/tiled/lib/src/exporter/json.dart b/packages/tiled/lib/src/exporter/json.dart index 6175d45..ad0e5ba 100644 --- a/packages/tiled/lib/src/exporter/json.dart +++ b/packages/tiled/lib/src/exporter/json.dart @@ -5,7 +5,7 @@ abstract class JsonObject { } class JsonList extends DelegatingList implements JsonObject { - JsonList([super.base = const []]); + JsonList([Iterable? base]) : super(base?.toList() ?? []); @override List get value => this; @@ -18,7 +18,9 @@ class JsonMap extends DelegatingMap implements JsonObject { Map get value => this; } -class JsonValue implements JsonObject { +class JsonValue implements JsonObject { @override - dynamic get value => this; + final T value; + + JsonValue(this.value); } diff --git a/packages/tiled/lib/src/layer.dart b/packages/tiled/lib/src/layer.dart index 95d2c5a..23bb83b 100644 --- a/packages/tiled/lib/src/layer.dart +++ b/packages/tiled/lib/src/layer.dart @@ -144,17 +144,13 @@ abstract class Layer extends Exportable { (json) => null, // data is just a string or list of int on JSON (xml) => xml.getSingleChildOrNull('data'), ); - final compression = parser.getCompressionOrNull('compression') ?? - dataNode?.getCompressionOrNull('compression'); - final encoding = parser.getFileEncodingOrNull('encoding') ?? - dataNode?.getFileEncodingOrNull('encoding') ?? - FileEncoding.csv; + final compression = parser.getCompressionOrNull('compression') ?? dataNode?.getCompressionOrNull('compression'); + final encoding = + parser.getFileEncodingOrNull('encoding') ?? dataNode?.getFileEncodingOrNull('encoding') ?? FileEncoding.csv; Chunk parseChunk(Parser e) => Chunk.parse(e, encoding, compression); - final chunks = parser.getChildrenAs('chunks', parseChunk) + - (dataNode?.getChildrenAs('chunk', parseChunk) ?? []); - final data = dataNode != null - ? parseLayerData(dataNode, encoding, compression) - : null; + final chunks = + parser.getChildrenAs('chunks', parseChunk) + (dataNode?.getChildrenAs('chunk', parseChunk) ?? []); + final data = dataNode != null ? parseLayerData(dataNode, encoding, compression) : null; layer = TileLayer( id: id, name: name, @@ -185,10 +181,8 @@ abstract class Layer extends Exportable { 'draworder', defaults: DrawOrder.topDown, ); - final colorHex = - parser.getString('color', defaults: ObjectGroup.defaultColorHex); - final color = - parser.getColor('color', defaults: ObjectGroup.defaultColor); + final colorHex = parser.getString('color', defaults: ObjectGroup.defaultColorHex); + final color = parser.getColor('color', defaults: ObjectGroup.defaultColor); final objects = parser.getChildrenAs('object', TiledObject.parse); layer = ObjectGroup( id: id, @@ -352,7 +346,7 @@ abstract class Layer extends Exportable { } @override - ExportElement export(ExportSettings settings); + ExportElement export(); } class TileLayer extends Layer { @@ -422,7 +416,7 @@ class TileLayer extends Layer { } @override - ExportElement export(ExportSettings settings) => ExportElement( + ExportElement export() => ExportElement( 'layer', { 'class': class_?.toExport(), @@ -437,8 +431,17 @@ class TileLayer extends Layer { 'compression': (data == null ? compression : null)?.name.toExport(), }.nonNulls(), { - if (chunks != null) 'chunks': ExportList.from(chunks!, settings), - if (data != null) 'data': TileData(data!).export(settings), + if (chunks != null) + 'chunks': ExportList(chunks!.map((e) => e.export( + encoding: encoding, + compression: compression, + ))), + if (data != null) + 'data': TileDataEncoder( + data: data!, + compression: compression, + encoding: encoding, + ).export(), }, ); } @@ -490,7 +493,7 @@ class ObjectGroup extends Layer { ); @override - ExportElement export(ExportSettings settings) => ExportElement( + ExportElement export() => ExportElement( 'objectgroup', { 'id': id?.toExport(), @@ -510,7 +513,7 @@ class ObjectGroup extends Layer { 'draworder': drawOrder.name.toExport(), }.nonNulls(), { - 'objects': ExportList.from(objects, settings), + 'objects': ExportList.from(objects), }, ); } @@ -562,7 +565,7 @@ class ImageLayer extends Layer { ); @override - ExportElement export(ExportSettings settings) => ExportElement( + ExportElement export() => ExportElement( 'imagelayer', { 'id': id?.toExport(), @@ -582,7 +585,7 @@ class ImageLayer extends Layer { 'repeaty': repeatY.toExport(), }.nonNulls(), { - 'image': image.export(settings), + 'image': image.export(), }); } @@ -613,7 +616,7 @@ class Group extends Layer { ); @override - ExportElement export(ExportSettings settings) => ExportElement( + ExportElement export() => ExportElement( 'group', { 'id': id?.toExport(), @@ -629,8 +632,8 @@ class Group extends Layer { 'parallaxy': parallaxY.toExport(), }.nonNulls(), { - 'layers': ExportList.from(layers, settings), + 'layers': ExportList.from(layers), }, - properties, + properties, ); } diff --git a/packages/tiled/lib/src/objects/text.dart b/packages/tiled/lib/src/objects/text.dart index 29a912d..a7d4de0 100644 --- a/packages/tiled/lib/src/objects/text.dart +++ b/packages/tiled/lib/src/objects/text.dart @@ -86,7 +86,7 @@ class Text extends Exportable { ); @override - ExportElement export(ExportSettings settings) => + ExportElement export() => ExportElement('text', { 'fontfamily': fontFamily.toExport(), 'pixelsize': pixelSize.toExport(), diff --git a/packages/tiled/lib/src/objects/tiled_object.dart b/packages/tiled/lib/src/objects/tiled_object.dart index ad017f6..1504d02 100644 --- a/packages/tiled/lib/src/objects/tiled_object.dart +++ b/packages/tiled/lib/src/objects/tiled_object.dart @@ -176,7 +176,7 @@ class TiledObject extends Exportable { } @override - ExportResolver export(ExportSettings settings) { + ExportResolver export() { final common = { 'id': id.toExport(), 'name': name.toExport(), @@ -214,7 +214,7 @@ class TiledObject extends Exportable { }, {}, ), - if (text != null) 'text': text!.export(settings), + if (text != null) 'text': text!.export(), }, properties ), diff --git a/packages/tiled/lib/src/tiled_map.dart b/packages/tiled/lib/src/tiled_map.dart index dab7784..ba0ce32 100644 --- a/packages/tiled/lib/src/tiled_map.dart +++ b/packages/tiled/lib/src/tiled_map.dart @@ -360,7 +360,7 @@ class TiledMap with Exportable { } @override - ExportElement export(ExportSettings settings) => ExportElement( + ExportElement export() => ExportElement( 'map', { 'version': '1.10'.toExport(), @@ -386,8 +386,8 @@ class TiledMap with Exportable { 'infinite': infinite.toExport(), }.nonNulls(), { - 'tilesets': ExportList.from(tilesets, settings), - 'layers': ExportList.from(layers, settings), + 'tilesets': ExportList.from(tilesets), + 'layers': ExportList.from(layers), }, properties, ); diff --git a/packages/tiled/lib/src/tileset/grid.dart b/packages/tiled/lib/src/tileset/grid.dart index 99378f7..5c8be92 100644 --- a/packages/tiled/lib/src/tileset/grid.dart +++ b/packages/tiled/lib/src/tileset/grid.dart @@ -31,7 +31,7 @@ class Grid extends Exportable { ); @override - ExportResolver export(ExportSettings settings) => ExportElement( + ExportResolver export() => ExportElement( 'grid', { 'orientation': orientation.name.toExport(), diff --git a/packages/tiled/lib/src/tileset/tile.dart b/packages/tiled/lib/src/tileset/tile.dart index 8c0e663..7118aca 100644 --- a/packages/tiled/lib/src/tileset/tile.dart +++ b/packages/tiled/lib/src/tileset/tile.dart @@ -90,7 +90,7 @@ class Tile with Exportable { } @override - ExportResolver export(ExportSettings settings) { + ExportResolver export() { final fields = { 'id': localId.toExport(), 'class': type?.toExport(), @@ -102,8 +102,8 @@ class Tile with Exportable { }.nonNulls(); final children = { - 'image': image?.export(settings), - 'objectgroup': objectGroup?.export(settings) + 'image': image?.export(), + 'objectgroup': objectGroup?.export() }.nonNulls(); return ExportFormatSpecific( @@ -117,7 +117,7 @@ class Tile with Exportable { 'animation', {}, { - 'frames': ExportList.from(animation, settings), + 'frames': ExportList.from(animation), }, ), }, @@ -128,7 +128,7 @@ class Tile with Exportable { fields, { ...children, - 'animation': ExportList.from(animation, settings), + 'animation': ExportList.from(animation), }, properties, ), diff --git a/packages/tiled/lib/src/tileset/tile_offset.dart b/packages/tiled/lib/src/tileset/tile_offset.dart index 3707e4b..c7bfa5c 100644 --- a/packages/tiled/lib/src/tileset/tile_offset.dart +++ b/packages/tiled/lib/src/tileset/tile_offset.dart @@ -27,7 +27,7 @@ class TileOffset extends Exportable { ); @override - ExportResolver export(ExportSettings settings) => ExportElement( + ExportResolver export() => ExportElement( 'tileoffset', { 'x': x.toExport(), diff --git a/packages/tiled/lib/src/tileset/tileset.dart b/packages/tiled/lib/src/tileset/tileset.dart index 5eb5909..43d7c46 100644 --- a/packages/tiled/lib/src/tileset/tileset.dart +++ b/packages/tiled/lib/src/tileset/tileset.dart @@ -263,8 +263,8 @@ class Tileset with Exportable { } @override - ExportResolver export(ExportSettings settings) => source == null - ? _export(settings, false) + ExportResolver export() => source == null + ? _export(false) : ExportElement( 'tileset', { @@ -274,10 +274,10 @@ class Tileset with Exportable { {}, ); - ExportResolver exportExternal(ExportSettings settings) => - _export(settings, true); + ExportResolver exportExternal() => + _export(true); - ExportResolver _export(ExportSettings settings, bool external) { + ExportResolver _export(bool external) { final fields = { if (!external) 'firstgid': firstGid!.toExport(), 'name': name!.toExport(), @@ -297,18 +297,18 @@ class Tileset with Exportable { }.nonNulls(); final common = { - 'image': image?.export(settings), - 'tiles': ExportList.from(tiles, settings), - 'tileoffset': tileOffset?.export(settings), - 'grid': grid?.export(settings), + 'image': image?.export(), + 'tiles': ExportList.from(tiles), + 'tileoffset': tileOffset?.export(), + 'grid': grid?.export(), // 'terraintypes': , DEPRECATED - // 'transformations': ExportList.from(transformations, settings), Not supported by this class + // 'transformations': ExportList.from(transformations), Not supported by this class }.nonNulls(); final wangsets = ExportElement( 'wangsets', {}, - {'wangsets': ExportList.from(wangSets, settings)}, + {'wangsets': ExportList.from(wangSets)}, properties, ); @@ -327,7 +327,7 @@ class Tileset with Exportable { fields, { ...common, - 'wangsets': ExportList.from(wangSets, settings), + 'wangsets': ExportList.from(wangSets), }, ), ); diff --git a/packages/tiled/lib/src/tileset/wang/wang_color.dart b/packages/tiled/lib/src/tileset/wang/wang_color.dart index b5cc36e..bd5fef7 100644 --- a/packages/tiled/lib/src/tileset/wang/wang_color.dart +++ b/packages/tiled/lib/src/tileset/wang/wang_color.dart @@ -39,7 +39,7 @@ class WangColor with Exportable { ); @override - ExportResolver export(ExportSettings settings) => ExportElement( + ExportResolver export() => ExportElement( 'wangcolor', { 'name': name.toExport(), diff --git a/packages/tiled/lib/src/tileset/wang/wang_set.dart b/packages/tiled/lib/src/tileset/wang/wang_set.dart index f693c96..9bbde4c 100644 --- a/packages/tiled/lib/src/tileset/wang/wang_set.dart +++ b/packages/tiled/lib/src/tileset/wang/wang_set.dart @@ -55,7 +55,7 @@ class WangSet extends Exportable { } @override - ExportResolver export(ExportSettings settings) { + ExportResolver export() { final colors = cornerColors..addAll(edgeColors); return ExportElement( @@ -65,8 +65,8 @@ class WangSet extends Exportable { 'tile': tile.toExport(), }, { - 'colors': ExportList.from(colors, settings), - 'wangtiles': ExportList.from(wangTiles, settings), + 'colors': ExportList.from(colors), + 'wangtiles': ExportList.from(wangTiles), }, properties, ); diff --git a/packages/tiled/lib/src/tileset/wang/wang_tile.dart b/packages/tiled/lib/src/tileset/wang/wang_tile.dart index 1aecb94..b530265 100644 --- a/packages/tiled/lib/src/tileset/wang/wang_tile.dart +++ b/packages/tiled/lib/src/tileset/wang/wang_tile.dart @@ -62,7 +62,7 @@ class WangTile with Exportable { } @override - ExportResolver export(ExportSettings settings) { + ExportResolver export() { final common = { 'tileid': tileId.toExport(), }; @@ -81,7 +81,7 @@ class WangTile with Exportable { 'wangtile', { ...common, - 'wangid': ExportLiteral(wangId), + 'wangid': ExportLiteral>(wangId), }, {}, ), diff --git a/packages/tiled/lib/tiled.dart b/packages/tiled/lib/tiled.dart index 784c944..5dce153 100644 --- a/packages/tiled/lib/tiled.dart +++ b/packages/tiled/lib/tiled.dart @@ -15,7 +15,6 @@ part 'src/data.dart'; part 'src/exporter/exportable.dart'; part 'src/exporter/export_value.dart'; part 'src/exporter/export_element.dart'; -part 'src/exporter/export_settings.dart'; part 'src/exporter/json.dart'; part 'src/common/enums.dart'; part 'src/common/flips.dart'; diff --git a/packages/tiled/test/exporter/map.dart b/packages/tiled/test/exporter/map.dart index 642bc78..ce2170e 100644 --- a/packages/tiled/test/exporter/map.dart +++ b/packages/tiled/test/exporter/map.dart @@ -5,8 +5,6 @@ import 'package:tiled/tiled.dart'; import 'package:xml/xml.dart'; void main() { - final settings = ExportSettings(encoding: null, compression: null); - late TiledMap export; setUp(() => export = TiledMap( width: 576, @@ -36,12 +34,12 @@ void main() { group('Exporter - Map', () { test( 'Xml', - () => testSuite(XmlParser(export.exportXml(settings) as XmlElement)), + () => testSuite(XmlParser(export.exportXml() as XmlElement)), ); test( 'Json', () => testSuite( - JsonParser(export.exportJson(settings) as Map)), + JsonParser(export.exportJson() as Map)), ); }); } diff --git a/packages/tiled/test/exporter/properties.dart b/packages/tiled/test/exporter/properties.dart index 039ebd0..bf1307a 100644 --- a/packages/tiled/test/exporter/properties.dart +++ b/packages/tiled/test/exporter/properties.dart @@ -4,8 +4,6 @@ import 'package:tiled/tiled.dart'; import 'package:xml/xml.dart'; void main() { - final settings = ExportSettings(encoding: null, compression: null); - late TiledObject export; late CustomProperties byName; setUp(() { @@ -28,10 +26,10 @@ void main() { group('Exporter - CustomProperties', () { test('Xml', - () => testSuite(XmlParser(export.exportXml(settings) as XmlElement))); + () => testSuite(XmlParser(export.exportXml() as XmlElement))); test( 'Json', () => testSuite( - JsonParser(export.exportJson(settings) as Map))); + JsonParser(export.exportJson() as Map))); }); }