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

Direction way #72

Merged
merged 4 commits into from
Apr 4, 2023
Merged

Direction way #72

merged 4 commits into from
Apr 4, 2023

Conversation

ManevilleF
Copy link
Owner

@ManevilleF ManevilleF commented Apr 4, 2023

Problem to solve

The current direction_to and diagonal_to methods can produce inaccurate results, as sometimes there is a Tie between two directions.
As a consequence, the corner_wedge produces some inaccuracies.

Solution

Added a DirectionalWay enum which can represent both a single direction and a tie and two new methods:

  • Hex::way_to
  • Hex::diagonal_way_to

This type can be unwraped to a single direction, and compared with directions directly

@ManevilleF ManevilleF added the enhancement New feature or request label Apr 4, 2023
@ManevilleF ManevilleF added this to the 0.6.0 milestone Apr 4, 2023
@ManevilleF ManevilleF marked this pull request as ready for review April 4, 2023 10:42
Copy link
Collaborator

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Makes sense: I ran into this when trying to figure out how to rotate my ants.

@ManevilleF ManevilleF merged commit a845f71 into main Apr 4, 2023
8 checks passed
@ManevilleF ManevilleF deleted the feat/direction_tie branch April 4, 2023 14:36
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

Successfully merging this pull request may close these issues.

None yet

2 participants