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

Port overmap API to points / tripoints #32645

Merged

Conversation

jbytheway
Copy link
Contributor

Summary

SUMMARY: None

Purpose of change

To have more expressive APIs, and move towards better type safety and cleaner code.

Similar to #32300, but this time for overmap rather than overmapbuffer.

Describe the solution

Convert all overmap member functions taking x, y, z arguments to take point or tripoint arguments instead.

Port all calling code to use these new APIs.

Add a couple of helpers to aid with this process:

  • om_to_omt_copy in coordinate_conversions.h
  • manhattan_dist in line.h
  • tripoint_above, tripoint_below, four_adjacent_offsets in point.h

Additional context

Working towards being able to meaningfully test #32017.

Convert all overmap member functions taking x, y, z arguments to take
points or tripoints instead.

Port all calling code to use these new APIs.

Add a couple of helpers to aid with this process:

- om_to_omt_copy in coordinate_conversions.h
- manhattan_dist in line.h
- tripoint_above, tripoint_below, four_adjacent_offsets in point.h
@KorGgenT KorGgenT added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Jul 26, 2019
@ZhilkinSerg ZhilkinSerg merged commit 8036bc1 into CleverRaven:master Jul 26, 2019
@jbytheway jbytheway deleted the overmap_point_api_overhaul branch July 27, 2019 11:55
jbytheway added a commit to jbytheway/Cataclysm-DDA that referenced this pull request Jul 27, 2019
Refactor some of this code for better clarity.

This was some refactoring that was supposed to be part of CleverRaven#32645 but I
failed to push it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants