Search in sources :

Example 1 with BodyStructureFacade

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

the class EquipmentSetFacadeImpl method buildNodeList.

private void buildNodeList() {
    nodeList = new DefaultListFacade<>();
    equipSlotNodeMap = new LinkedHashMap<>();
    int index = 0;
    for (BodyStructureFacade bodyStruct : dataSet.getEquipmentLocations()) {
        String structString = bodyStruct.toString();
        EquipNodeImpl node = new EquipNodeImpl((BodyStructure) bodyStruct, index++);
        nodeList.addElement(node);
        // Add locations for this body structure
        for (EquipSlot slot : SystemCollections.getUnmodifiableEquipSlotList()) {
            String bodyStructureName = slot.getBodyStructureName();
            final String hands = "HANDS";
            if ("Ring".equalsIgnoreCase(slot.getSlotName()) || "Fingers".equalsIgnoreCase(slot.getSlotName())) {
                bodyStructureName = hands;
            }
            if (bodyStructureName.equalsIgnoreCase(structString)) {
                if (slot.canContainType("WEAPON")) {
                    // Add phantom nodes for the various weapon slots
                    if (getPCHands() > 0) {
                        addEquipNodeForEquipSlot(node, createWeaponEquipSlot(slot, Constants.EQUIP_LOCATION_PRIMARY), true);
                    }
                    for (int i = 1; i < getPCHands(); ++i) {
                        if (i > 1) {
                            addEquipNodeForEquipSlot(node, createWeaponEquipSlot(slot, Constants.EQUIP_LOCATION_SECONDARY + " " + i), true);
                        } else {
                            addEquipNodeForEquipSlot(node, createWeaponEquipSlot(slot, Constants.EQUIP_LOCATION_SECONDARY), true);
                        }
                    }
                    addEquipNodeForEquipSlot(node, createWeaponEquipSlot(slot, Constants.EQUIP_LOCATION_DOUBLE), true);
                    addEquipNodeForEquipSlot(node, createWeaponEquipSlot(slot, Constants.EQUIP_LOCATION_BOTH), true);
                    addEquipNodeForEquipSlot(node, createWeaponEquipSlot(slot, Constants.EQUIP_LOCATION_UNARMED), true);
                } else {
                    addEquipNodeForEquipSlot(node, slot, false);
                }
            }
        }
    }
}
Also used : EquipSlot(pcgen.core.character.EquipSlot) BodyStructureFacade(pcgen.facade.core.BodyStructureFacade)

Aggregations

EquipSlot (pcgen.core.character.EquipSlot)1 BodyStructureFacade (pcgen.facade.core.BodyStructureFacade)1