Skip to content

Position2D.cs : How to get sort order in 2d space (and probably 3d space) #11

@nullorvoid

Description

@nullorvoid

Implementing the IComparable means that we have to implement the correct sorting order, I am thinking of using the value from 0 to do the ordering.

For instance:

Addition:
4|5|6
3|4|5
2|3|4

Multiplication:
3|6|9
2|4|6
1|2|3

Square + Addition:
10|13|18
05|08|13
01|05|10

Simple List:
7|8|9
4|5|6
1|2|3

This will probably be extended into 3d later so the system should work as such. The main question is whether or not we need to do this or whether we can implement IEqualityComparer for these interfaces and that will all that's required.

msdn

Tests also required and will be TODO in PositionTests.cs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions