Search in sources :

Example 11 with EquipmentFacade

use of pcgen.facade.core.EquipmentFacade in project pcgen by PCGen.

the class UnequippedList method quantityChanged.

@Override
public void quantityChanged(EquipmentListEvent e) {
    EquipmentFacade equipment = e.getEquipment();
    int quantity = purchasedList.getQuantity(equipment) - equippedList.getQuantity(equipment);
    if (quantity > 0) {
        if (quantityMap.containsKey(equipment)) {
            setQuantity(equipment, quantity);
        } else {
            addEquipment(equipment, quantity);
        }
    } else {
        removeEquipment(equipment);
    }
}
Also used : EquipmentFacade(pcgen.facade.core.EquipmentFacade)

Aggregations

EquipmentFacade (pcgen.facade.core.EquipmentFacade)11 Equipment (pcgen.core.Equipment)3 ArrayList (java.util.ArrayList)2 EquipSet (pcgen.core.character.EquipSet)2 BorderLayout (java.awt.BorderLayout)1 Box (javax.swing.Box)1 JCheckBox (javax.swing.JCheckBox)1 JComboBox (javax.swing.JComboBox)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 EmptyBorder (javax.swing.border.EmptyBorder)1 BodyStructure (pcgen.core.BodyStructure)1 EquipSlot (pcgen.core.character.EquipSlot)1 AbilityFacade (pcgen.facade.core.AbilityFacade)1 CharacterFacade (pcgen.facade.core.CharacterFacade)1 ClassFacade (pcgen.facade.core.ClassFacade)1 DeityFacade (pcgen.facade.core.DeityFacade)1 DomainFacade (pcgen.facade.core.DomainFacade)1 KitFacade (pcgen.facade.core.KitFacade)1 RaceFacade (pcgen.facade.core.RaceFacade)1