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

Method setRace

code/src/java/pcgen/core/PlayerCharacter.java:3273–3289  ·  view source on GitHub ↗

Changes the race of the character. First it removes the current Race, then add the new Race. @param newRace

(final Race newRace)

Source from the content-addressed store, hash-verified

3271 * @param newRace
3272 */
3273 public final boolean setRace(final Race newRace)
3274 {
3275 boolean success;
3276 if (newRace == null)
3277 {
3278 success = raceInputFacet.set(id, RaceUtilities.getUnselectedRace());
3279 } else
3280 {
3281 success = raceInputFacet.set(id, newRace);
3282 }
3283
3284 if (success)
3285 {
3286 calcActiveBonuses();
3287 }
3288 return success;
3289 }
3290
3291 /**
3292 * return bonus from a Race

Callers 15

testClassLevelMethod · 0.95
setUpMethod · 0.95
setUpMethod · 0.95
testSpellListDcTokenMethod · 0.95
testAddCompanionMethod · 0.95
testRandomizeMethod · 0.95

Calls 3

getUnselectedRaceMethod · 0.95
calcActiveBonusesMethod · 0.95
setMethod · 0.65

Tested by 15

testClassLevelMethod · 0.76
setUpMethod · 0.76
setUpMethod · 0.76
testSpellListDcTokenMethod · 0.76
testAddCompanionMethod · 0.76
testRandomizeMethod · 0.76