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

Class BonusSpellInfo

code/src/java/pcgen/cdom/content/BonusSpellInfo.java:24–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22import pcgen.cdom.base.Loadable;
23
24public class BonusSpellInfo implements Loadable
25{
26
27 private URI sourceURI;
28 private int statRange;
29 private int spellLevel;
30 private int statScore;
31
32 @Override
33 public URI getSourceURI()
34 {
35 return sourceURI;
36 }
37
38 @Override
39 public void setSourceURI(URI source)
40 {
41 sourceURI = source;
42 }
43
44 @Override
45 public void setName(String name)
46 {
47 try
48 {
49 int intValue = Integer.valueOf(name);
50 if (intValue < 1)
51 {
52 throw new IllegalArgumentException("Name must be an integer >= 1");
53 }
54 spellLevel = intValue;
55 }
56 catch (NumberFormatException nfe)
57 {
58 throw new IllegalArgumentException("Name must be an integer, found: " + name, nfe);
59 }
60 }
61
62 @Override
63 public String getDisplayName()
64 {
65 return String.valueOf(spellLevel);
66 }
67
68 @Override
69 public String getKeyName()
70 {
71 return getDisplayName();
72 }
73
74 @Override
75 public boolean isInternal()
76 {
77 return false;
78 }
79
80 @Override
81 public boolean isType(String type)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected