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

Method testApply

code/src/java/pcgen/core/kit/KitAlignment.java:60–88  ·  view source on GitHub ↗

testApply @param k @param aPC PlayerCharacter @param warnings List

(Kit k, PlayerCharacter aPC, List<String> warnings)

Source from the content-addressed store, hash-verified

58 * @param warnings List
59 */
60 @Override
61 public boolean testApply(Kit k, PlayerCharacter aPC, List<String> warnings)
62 {
63 align = null;
64 if (alignments.size() == 1)
65 {
66 align = alignments.get(0).get();
67 }
68 else
69 {
70 List<PCAlignment> available = new ArrayList<>(alignments.size());
71 for (CDOMSingleRef<PCAlignment> ref : alignments)
72 {
73 available.add(ref.get());
74 }
75 while (true)
76 {
77 List<PCAlignment> sel = new ArrayList<>(1);
78 sel = Globals.getChoiceFromList("Choose alignment", available, sel, 1, aPC);
79 if (sel.size() == 1)
80 {
81 align = sel.get(0);
82 break;
83 }
84 }
85 }
86 apply(aPC);
87 return RaceAlignment.canBeAlignment(aPC.getRace(), align);
88 }
89
90 @Override
91 public String getObjectName()

Callers

nothing calls this directly

Calls 7

getChoiceFromListMethod · 0.95
applyMethod · 0.95
canBeAlignmentMethod · 0.95
sizeMethod · 0.65
getMethod · 0.65
addMethod · 0.65
getRaceMethod · 0.45

Tested by

no test coverage detected