(PCClass c1, PCClass c2)
| 505 | { |
| 506 | |
| 507 | @Override |
| 508 | public int compare(PCClass c1, PCClass c2) |
| 509 | { |
| 510 | final int BEFORE = -1; |
| 511 | final int AFTER = 1; |
| 512 | |
| 513 | if (c1 == c2) |
| 514 | { |
| 515 | return 0; |
| 516 | } |
| 517 | |
| 518 | final String BASE_TYPE = "BASE.PC"; |
| 519 | if (c1.isType(BASE_TYPE) && !c2.isType(BASE_TYPE)) |
| 520 | { |
| 521 | return BEFORE; |
| 522 | } |
| 523 | if (!c1.isType(BASE_TYPE) && c2.isType(BASE_TYPE)) |
| 524 | { |
| 525 | return AFTER; |
| 526 | } |
| 527 | |
| 528 | final String PRESTIGE_TYPE = "Prestige"; |
| 529 | if (c1.isType(PRESTIGE_TYPE) && !c2.isType(PRESTIGE_TYPE)) |
| 530 | { |
| 531 | return BEFORE; |
| 532 | } |
| 533 | if (!c1.isType(PRESTIGE_TYPE) && c2.isType(PRESTIGE_TYPE)) |
| 534 | { |
| 535 | return AFTER; |
| 536 | } |
| 537 | |
| 538 | final String NPC_TYPE = "NPC"; |
| 539 | if (c1.isType(NPC_TYPE) && !c2.isType(NPC_TYPE)) |
| 540 | { |
| 541 | return BEFORE; |
| 542 | } |
| 543 | if (!c1.isType(NPC_TYPE) && c2.isType(NPC_TYPE)) |
| 544 | { |
| 545 | return AFTER; |
| 546 | } |
| 547 | |
| 548 | // Check sort keys |
| 549 | String key1 = c1.get(StringKey.SORT_KEY); |
| 550 | if (key1 == null) |
| 551 | { |
| 552 | key1 = c1.getDisplayName(); |
| 553 | } |
| 554 | String key2 = c2.get(StringKey.SORT_KEY); |
| 555 | if (key2 == null) |
| 556 | { |
| 557 | key2 = c2.getDisplayName(); |
| 558 | } |
| 559 | final Collator collator = Collator.getInstance(); |
| 560 | return collator.compare(key1, key2); |
| 561 | } |
| 562 | |
| 563 | } |
| 564 |
nothing calls this directly
no test coverage detected