I have an array list of 10 items. I want to sort this items by their parameters but I'm not exactly sure how.
The signature for my items in the array list is:
Creature(String n, Terrain startTerrain, boolean flying, boolean magic, boolean charge, boolean ranged, int combat)
So essentially I want to have my array list sorted so it's creatures where magic is true, they are first, then creatures where ranged is first, they appear next in the list, and then everything else.
I have only worked with bubble sort, and I'm not sure how to implement this. Any hints?
Collections.sortwith a custom comparator.