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

Documentation: GID code example rename tileAt to get_tile #3807

Merged
merged 1 commit into from
Aug 17, 2023
Merged

Documentation: GID code example rename tileAt to get_tile #3807

merged 1 commit into from
Aug 17, 2023

Conversation

eishiya
Copy link
Contributor

@eishiya eishiya commented Aug 15, 2023

Updated the example C++ code to use "get_tile" as the hypothetical method to get a tile based on its ID instead of "tileAt", for two reasons:

  1. The rest of the code uses snake_case, but this one used camelCase for some reason.
  2. "tileAt" sounds like it implies that the ID is a location/index. This is misleading, since in Tiled tilesets, the ids are not necessarily positions or indices - tiles may be stored out of order, and the IDs may not even be sequential. I think "get tile" avoids such implications.

As far as I can tell, this shouldn't affect any localisations, as no translations touch the sample code.

Updated the example C++ code to use "get_tile" as the hypothetical method to get a tile based on its ID instead of "tileAt", for two reasons:

1. The rest of the code uses snake_case, but this one used camelCase for some reason.
2. "tileAt" sounds like it implies that the ID is a location/index. This is misleading, since in Tiled tilesets, the ids are not necessarily positions or indices - tiles may be stored out of order, and the IDs may not even be sequential. I think "get tile" avoids such implications.
@eishiya eishiya changed the title Documentation: GID code example tweaks Documentation: GID code example rename tileAt to get_tile Aug 15, 2023
@bjorn bjorn merged commit 1316353 into mapeditor:master Aug 17, 2023
1 check passed
@bjorn
Copy link
Member

bjorn commented Aug 17, 2023

Thanks!

Next time I'm adjusting my existing C++ code, I should probably just ask some AI to convert the naming style. It will do a better job than me. :P

@eishiya eishiya deleted the eishiya-patch-1 branch August 17, 2023 12:47
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.

2 participants