Skip to content

feat: add intersection logic to the shape structure#48

Merged
theEvilReaper merged 4 commits intodevelopfrom
feature/intersect
Mar 8, 2026
Merged

feat: add intersection logic to the shape structure#48
theEvilReaper merged 4 commits intodevelopfrom
feature/intersect

Conversation

@theEvilReaper
Copy link
Contributor

Proposed changes

Integrates the Intersect interface into the Shape interface to provide a unified way to check if a position intersects with a shape.

Types of changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of
them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before
merging your code.

  • I have read the CONTRIBUTING.md
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@theEvilReaper theEvilReaper self-assigned this Mar 5, 2026
@theEvilReaper theEvilReaper added the documentation Improvements or additions to documentation label Mar 5, 2026
Comment on lines +30 to +44
/**
* {@inheritDoc}
*/
@Override
public boolean intersect2D(Point position) {
return this.intersect3D(position);
}

/**
* {@inheritDoc}
*/
@Override
public boolean intersect3D(Point position) {
return this.position.equals(position);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there some difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no real difference for points. Two points intersect if they share the same position, so intersect2D simply delegates to intersect3D to avoid code duplication.

@theEvilReaper theEvilReaper merged commit 55bd439 into develop Mar 8, 2026
7 checks passed
@theEvilReaper theEvilReaper deleted the feature/intersect branch March 8, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants