Sets the base attribute of the Equipment object Todo remove the pc parameter, it is unused.
()
| 3645 | * Todo remove the pc parameter, it is unused. |
| 3646 | */ |
| 3647 | public void setBase() |
| 3648 | { |
| 3649 | |
| 3650 | if (get(ObjectKey.BASE_ITEM) == null) |
| 3651 | { |
| 3652 | Equipment eq = Globals.getContext().getReferenceContext().silentlyGetConstructedCDOMObject(Equipment.class, |
| 3653 | getKeyName()); |
| 3654 | if (eq != null) |
| 3655 | { |
| 3656 | put(ObjectKey.BASE_ITEM, CDOMDirectSingleRef.getRef(eq)); |
| 3657 | } |
| 3658 | else |
| 3659 | { |
| 3660 | Logging |
| 3661 | .errorPrint("Unable to find base item for " + this.getDisplayName() + " with key " + getKeyName()); |
| 3662 | } |
| 3663 | } |
| 3664 | |
| 3665 | if (hasConsolidatedProfName()) |
| 3666 | { |
| 3667 | CDOMSingleRef<Equipment> baseItem = get(ObjectKey.BASE_ITEM); |
| 3668 | if (baseItem != null) |
| 3669 | { |
| 3670 | Equipment eq = baseItem.get(); |
| 3671 | CDOMSingleRef<WeaponProf> wpRef = eq.get(ObjectKey.WEAPON_PROF); |
| 3672 | if (wpRef != null) |
| 3673 | { |
| 3674 | put(ObjectKey.WEAPON_PROF, wpRef); |
| 3675 | } |
| 3676 | CDOMSingleRef<ArmorProf> apRef = eq.get(ObjectKey.ARMOR_PROF); |
| 3677 | if (apRef != null) |
| 3678 | { |
| 3679 | put(ObjectKey.ARMOR_PROF, apRef); |
| 3680 | } |
| 3681 | CDOMSingleRef<ShieldProf> spRef = eq.get(ObjectKey.SHIELD_PROF); |
| 3682 | if (spRef != null) |
| 3683 | { |
| 3684 | put(ObjectKey.SHIELD_PROF, spRef); |
| 3685 | } |
| 3686 | } |
| 3687 | } |
| 3688 | } |
| 3689 | |
| 3690 | public String consolidatedProfName() |
| 3691 | { |