Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: matthutton on October 15, 2019, 02:50:07 PM

Title: Sort on multiple dimensions
Post by: matthutton on October 15, 2019, 02:50:07 PM
I need to sort on two values. In this case, each user will have a score and a time. I'd like to sort first by their score, and then in the case of ties, by their time. Is that something I can do using hash tables and array lists?
Title: Re: Sort on multiple dimensions
Post by: jeanfabre on October 16, 2019, 02:28:03 AM
Hi,

 yes, you can do that, I would for example do two arrays, one sorted by score and another by time.

 then when you build the final list you go through the score array, and when the same, you can check in the time array and use that order to decide who gets first.

It's cumbersome, I give you that.

Bye,

 Jean