FIUS / ICGE2

Version 2 of the Introduction Course Game Engine for the FIUS Java Introduction Course
MIT License
5 stars 4 forks source link

Default comparators for Positions #195

Open buehlefs opened 4 years ago

buehlefs commented 4 years ago

There are no default comparators for positions. Positions are often sorted before they can be used in a TaskVerifier. It would be beneficial to provide one or more comparator to be used by the TaskVerifiers.

Vogel612 commented 4 years ago

Comparator.comparing(Position::getX).thenComparing(Position::getY) seems quite... workable to me

buehlefs commented 4 years ago

I will leave this issue open for now as this should be added to the documentation of Position. This would make this option more visible expecially for java newcomers (and someone who does not know much about the Comparator package from java like me...)