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

Class DeityToken

code/src/java/plugin/primitive/domain/DeityToken.java:40–113  ·  view source on GitHub ↗

DeityToken is a Primitive that includes the Domains granted by the PC's Deity.

Source from the content-addressed store, hash-verified

38 * DeityToken is a Primitive that includes the Domains granted by the PC's Deity.
39 */
40public class DeityToken implements PrimitiveToken<Domain>
41{
42
43 private static final Class<Domain> DOMAIN_CLASS = Domain.class;
44
45 @Override
46 public boolean initialize(LoadContext context, Class<Domain> cl, String value, String args)
47 {
48 return (value == null) && (args == null);
49 }
50
51 @Override
52 public String getTokenName()
53 {
54 return "DEITY";
55 }
56
57 @Override
58 public Class<Domain> getReferenceClass()
59 {
60 return DOMAIN_CLASS;
61 }
62
63 @Override
64 public String getLSTformat(boolean useAny)
65 {
66 return getTokenName();
67 }
68
69 @Override
70 public GroupingState getGroupingState()
71 {
72 return GroupingState.ANY;
73 }
74
75 @Override
76 public boolean equals(Object obj)
77 {
78 return obj instanceof DeityToken;
79 }
80
81 @Override
82 public int hashCode()
83 {
84 return 8635;
85 }
86
87 @Override
88 public <R> Collection<R> getCollection(PlayerCharacter pc, Converter<Domain, R> c)
89 {
90 HashSet<R> returnSet = new HashSet<>();
91 Deity deity = (Deity) ChannelUtilities
92 .readControlledChannel(pc.getCharID(), CControl.DEITYINPUT);
93 if (deity == null)
94 {
95 return returnSet;
96 }
97 CDOMReference<DomainList> list = Deity.DOMAINLIST;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected