Search in sources :

Example 1 with InventoryWeaponComparator

use of com.lilithsthrone.utils.InventoryWeaponComparator in project liliths-throne-public by Innoxia.

the class CharacterInventory method recalculateMapOfDuplicateWeapons.

private void recalculateMapOfDuplicateWeapons() {
    weaponDuplicates.clear();
    weaponsInInventory.sort(new InventoryWeaponComparator());
    for (AbstractWeapon weapon : weaponsInInventory) {
        if (!weaponDuplicates.containsKey(weapon))
            weaponDuplicates.put(weapon, 1);
        else
            weaponDuplicates.put(weapon, weaponDuplicates.get(weapon) + 1);
    }
}
Also used : InventoryWeaponComparator(com.lilithsthrone.utils.InventoryWeaponComparator) AbstractWeapon(com.lilithsthrone.game.inventory.weapon.AbstractWeapon)

Aggregations

AbstractWeapon (com.lilithsthrone.game.inventory.weapon.AbstractWeapon)1 InventoryWeaponComparator (com.lilithsthrone.utils.InventoryWeaponComparator)1