ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Cameo Sorting

From ModEnc
Revision as of 10:50, 27 July 2008 by DCoder (talk | contribs) (Rewriting from sourcecode)
Jump to: navigation, search

Cameos on the sidebar are sorted according to several factors. Whenever a cameo is added to the tab, the game iterates over all the existing cameos comparing each of them with the new cameo in turn.

In the examples below, OldCameo stands for the cameo that was already there, NewCameo is the cameo the game is trying to insert.

Superweapon Cameos

If both OldCameo and NewCameo are Superweapons (the actual superweapons, not buildings with a SuperWeapon attached):

Compare Template:TTL
The on which recharges faster gets priority. If they're equal...
Compare their Template:TTL strings
If, comparing alphabetically (lexicographically), OldCameo comes first, it gets priority, otherwise NewCameo does.

If one of them is a SuperWeapon and the other one isn't, the SuperWeapon one gets priority.

TechnoType Cameos

Compare Template:TTL
If one cameo's side is the same as the player house's Side, and the other one's isn't, whichever has the same side gets priority. Otherwise...
If both objects are UnitTypes or AircraftTypes
Objects with Template:TTL get priority over objects without it.
Objects with Template:TTL get priority over objects without it. If they're still equal...
Compare their Template:TTL
Lower TechLevel wins.
Compare their Template:TTL for player's house, taking into account all applicable cost multipliers
Lower Cost wins.
Compare their Template:TTL strings
If OldCameo alphabetically sorts first, it wins.