SetTile will no longer throw a DuplicateKeyException #802
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Optimo found a bug which was caused by the changes a made to the datastructure:
When trying to set a tile which already exists, a DuplicateKeyException is thrown. This is fixed now.
Because of the comment on the method:
I realized that there were two supported ways to replace a tile before my change:
The second way is now no longer possible. Using the second way will lead to unwanted behaviour.
Directly changing the TmxLayerTile also made it possible to change the flip flags. I think that's an edge case but I don't want to strip down the functionality for the users of the framework.
To avoid unwanted behaviour, I made the Gid and Flags readonly to force the use of the SetTile-method.
To make it possible again to also change the flags, I added an overloaded SetTile-Method.
Please let me know if these changes are ok.
Best regards,
stallratte