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

Test Function on custom TsxProvider`s #70

Open
benni-tec opened this issue Oct 28, 2023 · 1 comment
Open

Test Function on custom TsxProvider`s #70

benni-tec opened this issue Oct 28, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@benni-tec
Copy link

benni-tec commented Oct 28, 2023

What could be improved

Instead of checking by filename TsxProvider (or a new base class) could provide a function to check if a source can be resolved by the Provider.

Why should this be improved

As I have mentioned in #69 (nice) I am currently working on a CLI to optimize tmx files. For this I resolve tsx files relative to the respective tmx file. Currently this has to be done by parsing to XML beforehand and resolving the tsx locations and then generating a TsxProvider for each. This seems rather inefficient

Any risks?

I believe that this carries minmal risk, since the current functionality could be easily kept as a implementation of a new TsxProviderBase. Therefore no public contracts, naming or functionality would need to change, while greatly extending the capability of custom TsxProvider`s.

More information

I would gladly prepare a PR for this and improving documentation both in the README.md (which currently is wrong) and in code to explain this behaviour! I have already implemented this in the "#70-tsx-provider" branch of my fork.

@benni-tec benni-tec added the enhancement New feature or request label Oct 28, 2023
@benni-tec benni-tec changed the title Test Function on custom TsxParser`s Test Function on custom TsxProvider`s Oct 28, 2023
benni-tec pushed a commit to benni-tec/tiled_dart that referenced this issue Oct 28, 2023
@benni-tec
Copy link
Author

I was also curious which purpouse the static parse(String key) method on TsxProvider servers, since static methods can not be extended in superclasses or extensions in dart as far as I know. This confused me in the beginning and since the method is ever only able to throw an exception I think it could just be removed?

benni-tec pushed a commit to benni-tec/tiled_dart that referenced this issue Nov 6, 2023
benni-tec pushed a commit to benni-tec/tiled_dart that referenced this issue Jan 16, 2024
# Conflicts:
#	packages/tiled/lib/src/tileset/tile.dart
#	packages/tiled/pubspec.yaml
#	packages/tiled/test/parser_test.dart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant