radicaled / tmx.dart

(Discontinued) A Dart package for parsing TMX (Tile Map XML) files on both the client and server
MIT License
4 stars 0 forks source link

Object Layers #2

Closed TheNetBird closed 10 years ago

TheNetBird commented 10 years ago

Are object layers not currently supported? I couldn't find them, but they very well could be there and I just didn't see where.

Thanks for making this by the way

radicaled commented 10 years ago

Hey @TheNetBird I don't think object layers are implemented.

I will look into adding them to tmx.dart.

TheNetBird commented 10 years ago

Ok, sounds good

radicaled commented 10 years ago

@TheNetBird This is in master.

Check it out and let me know if the API suits your needs:

# pubspec.yaml
dependencies:
  tmx:
    git: git://github.com/radicaled/tmx.dart.git

I'm not really using objectlayers in an API yet, so I basically copied the API for layers.

TheNetBird commented 10 years ago

Gave it a whirl and ran into a couple things, On line 7 of Object_group it needs to = 1.0 rather than 1 (I make that mistake all the time)

The next error I got was Uncaught Error: type 'MappedIterable' is not a subtype of type 'List' of 'value'. Stack Trace:

0 ObjectGroup.tmxObjects= (package:tmx/src/object_group.dart:13:19)

1 ObjectGroup.ObjectGroup.fromXML (package:tmx/src/object_group.dart:30:5)

2 TileMapParser.parse. (package:tmx/src/tile_map_parser.dart:26:36)

I don't understand this one... to me it looks like you are instantiating the list fine

radicaled commented 10 years ago

That last error is because Dart runs tests in non-checked mode, and I keep forgetting that and everything seems fine because all the tests pass. But since I'm not using ObjectGroup in production that code never gets exercised in checked mode. :/

radicaled commented 10 years ago

I fixed the type problem and ran the test suite in checked mode -- still passing. Check out master now.

TheNetBird commented 10 years ago

Looks good, the fields in the api I need are loading correctly and I'll start using it in my code tomorrow.

Major appreciation for your quick action on adding this, really helpful :)

radicaled commented 10 years ago

Alright. I'm going to let this code sit in master for a bit. If you come across any issues with this implementation in the next few days, let me know. I'll probably cut a new release on Friday or Saturday.

Otherwise, feel free to open issues on any other problematic or uncomfortable areas in the API.

radicaled commented 10 years ago

Merged into master and released as v0.11.4