MCPcopy Create free account
hub / github.com/PCGen/pcgen / addWeaponToLocation

Method addWeaponToLocation

code/src/java/pcgen/core/Equipment.java:5931–5944  ·  view source on GitHub ↗

Add a Weapon to an Equipment Location. @param num how many pieces to add @param eLoc the Location to add the weapon to @param aPC the PC to quip the weapon on

(Float num, EquipmentLocation eLoc, PlayerCharacter aPC)

Source from the content-addressed store, hash-verified

5929 * @param aPC the PC to quip the weapon on
5930 */
5931 public void addWeaponToLocation(Float num, EquipmentLocation eLoc, PlayerCharacter aPC)
5932 {
5933 float numEquipped = (eLoc == EquipmentLocation.EQUIPPED_TWO_HANDS) ? 2.0f : num;
5934 setNumberEquipped((int) numEquipped);
5935
5936 setLocation(eLoc);
5937
5938 if (eLoc != EquipmentLocation.EQUIPPED_NEITHER)
5939 {
5940 setQty(num);
5941 setNumberCarried(num);
5942 setIsEquipped(true, aPC);
5943 }
5944 }
5945
5946 /**
5947 * Add a piece of general equipment to an Equipment Location.

Callers 1

equipItemMethod · 0.80

Calls 5

setNumberEquippedMethod · 0.95
setLocationMethod · 0.95
setQtyMethod · 0.95
setNumberCarriedMethod · 0.95
setIsEquippedMethod · 0.95

Tested by

no test coverage detected