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

Add convenience helper methods for Directions and RoomXY #517

Merged
merged 5 commits into from
May 28, 2024

Conversation

jciskey
Copy link
Contributor

@jciskey jciskey commented May 28, 2024

This PR implements two helper methods.

The first is a convenience method for Direction, to make it more convenient to iterate over all 8 directions in cases where that's necessary.

The second is a convenience method for local RoomXY, to get all valid neighbors of a particular location. This also showcases the convenience provided by the Direction iterator method, and how it cleans up code.

@shanemadden shanemadden merged commit 6f47235 into rustyscreeps:main May 28, 2024
10 checks passed
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