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
| 67 | * |
| 68 | */ |
| 69 | public 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 "Feat" 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 | */ |
nothing calls this directly
no test coverage detected