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

Rework Path to Implement ReadOnlyList #329

Open
Chris3606 opened this issue Feb 10, 2024 · 0 comments
Open

Rework Path to Implement ReadOnlyList #329

Chris3606 opened this issue Feb 10, 2024 · 0 comments
Milestone

Comments

@Chris3606
Copy link
Owner

Given modern C# supporting indices, ranges, etc; it would make sense for path to implement ReadOnlyList. GetStepWithStart is a very rare exception to the rule and that function could remain as is, however I propose the following API:

class Path : IReadOnlyList<Point>
{
     public Point this[int index] => /* Index of point not including start */
     public int Count => /* Length not including start */
     // GetStepWithStart could remain, so could Length.  GetStep itself could be removed or marked as deprecated.
}
@Chris3606 Chris3606 added this to the 3.0 milestone Feb 10, 2024
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

No branches or pull requests

1 participant