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);
}
}
Aggregations