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

Method getActiveBonuses

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

returns all BonusObj's that are "active" @param aPC PlayerCharacter used to check prereqs for bonuses @return active bonuses

(final PlayerCharacter aPC)

Source from the content-addressed store, hash-verified

541 * @return active bonuses
542 */
543 @Override
544 public List<BonusObj> getActiveBonuses(final PlayerCharacter aPC)
545 {
546 final List<BonusObj> aList = getRawBonusList(aPC).stream().filter(aPC::isApplied).collect(Collectors.toList());
547
548 List<EquipmentModifier> eqModList = getEqModifierList(true);
549
550 eqModList.stream().map(eqMod -> eqMod.getActiveBonuses(this, aPC)).forEach(aList::addAll);
551
552 eqModList = getEqModifierList(false);
553
554 eqModList.stream().map(eqMod -> eqMod.getActiveBonuses(this, aPC)).forEach(aList::addAll);
555
556 return aList;
557 }
558
559 /**
560 * get a list of BonusObj's of aType and aName

Callers 1

Calls 5

getEqModifierListMethod · 0.95
streamMethod · 0.80
forEachMethod · 0.80
getActiveBonusesMethod · 0.65
getRawBonusListMethod · 0.45

Tested by

no test coverage detected