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

Method addKeyedTemplate

code/src/java/pcgen/io/PCGVer2Parser.java:428–451  ·  view source on GitHub ↗
(PCTemplate template, String choice)

Source from the content-addressed store, hash-verified

426 }
427
428 private void addKeyedTemplate(PCTemplate template, String choice)
429 {
430 if (ChooseActivation.hasNewChooseToken(template) && choice == null)
431 {
432 final String message =
433 "Template ignored: " + template + " as a choice was expected but none was present in character.";
434 warnings.add(message);
435 return;
436 }
437 final int preXP = thePC.getXP();
438 templateInputFacet.importSelection(thePC.getCharID(), template, choice);
439 thePC.addTemplate(template);
440
441 //
442 // XP written to file contains leveladjustment XP. If template modifies
443 // XP, then
444 // it will have already been added into total. Need to make sure it is
445 // not doubled.
446 //
447 if (thePC.getXP() != preXP)
448 {
449 thePC.setXP(preXP);
450 }
451 }
452
453 private void cacheLine(String s)
454 {

Callers 1

parseTemplateLineMethod · 0.95

Calls 7

hasNewChooseTokenMethod · 0.95
getXPMethod · 0.80
addMethod · 0.65
getCharIDMethod · 0.65
addTemplateMethod · 0.65
setXPMethod · 0.65
importSelectionMethod · 0.45

Tested by

no test coverage detected