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

Class AbilityCategory

code/src/java/pcgen/core/AbilityCategory.java:69–830  ·  view source on GitHub ↗

This class stores and manages information about Ability categories. This is a higher level abstraction than the category specified by the ability object itself. The low-level AbilityCategory defaults to the same as this category key but this can be changed. For example to specify an Abilit

Source from the content-addressed store, hash-verified

67 *
68 */
69public class AbilityCategory
70 implements Category<Ability>, Loadable, ManufacturableFactory<Ability>
71{
72 private static final ClassIdentity<AbilityCategory> IDENTITY =
73 BasicClassIdentity.getIdentity(AbilityCategory.class);
74
75 private URI sourceURI;
76
77 private String keyName;
78 private String displayName;
79 private String pluralName;
80
81 private CDOMSingleRef<AbilityCategory> parentCategory;
82 private Set<CDOMSingleRef<Ability>> containedAbilities = null;
83 private DisplayLocation displayLocation;
84 private boolean isAllAbilityTypes = false;
85 private Set<Type> types = null;
86 private Formula poolFormula = FormulaFactory.ZERO;
87
88 private Visibility visibility = Visibility.DEFAULT;
89 private boolean isEditable = true;
90 private boolean isPoolModifiable = true;
91 private boolean isPoolFractional = false;
92 private boolean isInternal = false;
93
94 /** A constant used to refer to the &quot;Feat&quot; category. */
95 public static final AbilityCategory FEAT = new AbilityCategory("FEAT", "in_feat"); //$NON-NLS-1$ //$NON-NLS-2$
96 public static final AbilityCategory LANGBONUS = new AbilityCategory("*LANGBONUS"); //$NON-NLS-1$
97 public static final AbilityCategory ANY = new AbilityCategory("ANY"); //$NON-NLS-1$
98
99 static
100 {
101 FEAT.pluralName = LanguageBundle.getString("in_feats"); //$NON-NLS-1$
102 FEAT.displayLocation = DisplayLocation.getConstant(LanguageBundle.getString("in_feats")); //$NON-NLS-1$
103 FEAT.setInternal(true);
104 LANGBONUS.setPoolFormula(FormulaFactory.getFormulaFor("BONUSLANG"));
105 LANGBONUS.setInternal(true);
106 }
107
108 /**
109 * Constructs a new <tt>AbilityCategory</tt> with the specified key.
110 *
111 * <p>This method sets the display and plural names to the same value as
112 * the key name.
113 */
114 public AbilityCategory()
115 {
116 //For fooling other things
117 keyName = "";
118 //Self until proven otherwise
119 parentCategory = CDOMDirectSingleRef.getRef(this);
120 }
121
122 /**
123 * Update this ability category using the values from the supplied
124 * ability category.
125 * @param srcCat The category to be copied.
126 */

Callers

nothing calls this directly

Calls 6

getIdentityMethod · 0.95
getStringMethod · 0.95
getConstantMethod · 0.95
getFormulaForMethod · 0.95
setPoolFormulaMethod · 0.80
setInternalMethod · 0.45

Tested by

no test coverage detected