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

Method getCopyMasterBAB

code/src/java/pcgen/cdom/facet/MasterFacet.java:102–122  ·  view source on GitHub ↗

Gets a Master BAB Formula string from any of the CompanionMod items for the PlayerCharacter identified by the given CharID. The first CompanionMod item that has a Master BAB Formula will be used. Order of CompanionMod objects is not guaranteed by this Facet. @param id The CharID for whic

(CharID id)

Source from the content-addressed store, hash-verified

100 * for the Player Character identified by the given CharID
101 */
102 public String getCopyMasterBAB(CharID id)
103 {
104 for (CompanionMod cMod : companionModFacet.getSet(id))
105 {
106 /*
107 * TODO This is the "slow" method - proper solution here is to get
108 * TYPE in CompanionMod to be "special" and actually store a
109 * CompanionList object, not a String
110 */
111 if (cMod.getType().equalsIgnoreCase(get(id).getType().getKeyName()))
112 {
113 String copyMasterBAB = cMod.get(StringKey.MASTER_BAB_FORMULA);
114 if (copyMasterBAB != null)
115 {
116 return copyMasterBAB;
117 }
118 }
119 }
120
121 return Constants.EMPTY_STRING;
122 }
123
124 /**
125 * Gets whether Use Master Skill is set for any of the CompanionMod items

Callers 2

getAttackStringMethod · 0.80
baseAttackBonusMethod · 0.80

Calls 5

equalsIgnoreCaseMethod · 0.80
getSetMethod · 0.65
getTypeMethod · 0.65
getKeyNameMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected