Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize crate #104

Merged
merged 1 commit into from
Oct 15, 2021
Merged

Reorganize crate #104

merged 1 commit into from
Oct 15, 2021

Conversation

aleokdev
Copy link
Contributor

@aleokdev aleokdev commented Oct 12, 2021

This is an updated version of #43. It splits lib.rs into the following modules:

  • animation: For Frame
  • error: For ParseTileError & TiledError
  • image: For Image
  • layers: For LayerTile, Layer, LayerData, ImageLayer & Chunk
  • map: For Map & Orientation
  • objects: For ObjectGroup, ObjectShape & Object
  • properties: For Colour, PropertyValue & Properties
  • tile: For Tile
  • tileset: For Tileset
  • util: Private, for all the macros & internal parse functions

While by itself this change won't improve the external interface by much, this reorganization will allow for further development on current types such as Properties, which is an alias right now, and is essential to allow for quickly browsing through the library.

Copy link
Contributor

@mattyhall mattyhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mattyhall mattyhall merged commit d9cf8d7 into mapeditor:master Oct 15, 2021
@aleokdev aleokdev deleted the reorganization branch December 17, 2021 20:18
This was referenced Dec 23, 2021
@bjorn
Copy link
Member

bjorn commented Jan 24, 2022

@alexdevteam I've just adjusted bevy_ecs_tilemap to work with the current git version of rs-tiled: bjorn/bevy_ecs_tilemap@eb360e5

I found the need to prefix every rs-tiled type with its specific module name a bit annoying. Is that how things are done in Rust, or is there a way to avoid this?

What I've tried is to add something like use tiled::map::Map; at the top, but that didn't really work since it created an ambiguity with bevy_ecs_tilemap::map::Map. Personally I would still like the basic types to be available at the top level, like tiled::Map, since it allows resolving the ambiguity while avoiding the verbosity of map::Map.

@aleokdev
Copy link
Contributor Author

Yes, I agree that publically exporting essential types on the root is a good idea. Could add a few pub uses on lib.rs.

@aleokdev aleokdev added this to the 0.10.0 milestone Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants