Winterbay
Active member
I have an int[skill]-map where the int is the manacost of the skill. I'd like to sort the map by mana cost but can't figure out how to do it.
The function generating the map looks like this:
Adding a "sort allmyskills by value" does not appear to help. Is there another, preferably easy, way to do this?
ETA: Currently the list seems to be in alphabetical order of skill name.
The function generating the map looks like this:
Code:
int [skill] allMySkills()
{
int [skill] allmyskills;
foreach s in $skills[Spaghetti Spear, Ravioli Shurikens, Cannelloni Cannon, Stuffed Mortar Shell, Weapon of the Pastalord, Salsaball, Stream of Sauce, Saucestorm, Wave of Sauce, Saucegeyser]
{
if (have_skill(s))
{
allmyskills[s] = mp_cost(s);
}
}
return allmyskills;
}
Adding a "sort allmyskills by value" does not appear to help. Is there another, preferably easy, way to do this?
ETA: Currently the list seems to be in alphabetical order of skill name.