Skip to content

Rework Path to Implement ReadOnlyList #329

@Chris3606

Description

@Chris3606

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.
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions