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

Method removeClass

code/src/java/pcgen/cdom/facet/model/ClassFacet.java:148–165  ·  view source on GitHub ↗

Remove the given PCClass from the list of PCClass objects stored in this ClassFacet for the Player Character represented by the given CharID. @param id The CharID representing the Player Character from which the given PCClass should be removed @param obj The PCClass

(CharID id, PCClass obj)

Source from the content-addressed store, hash-verified

146 * represented by the given CharID
147 */
148 public void removeClass(CharID id, PCClass obj)
149 {
150 Objects.requireNonNull(obj, "PCClass to add may not be null");
151 ClassInfo info = getClassInfo(id);
152 if (info != null)
153 {
154 if (info.containsClass(obj))
155 {
156 setLevel(id, obj, 0);
157 info.removeClass(obj);
158 fireDataFacetChangeEvent(id, obj, DataFacetChangeEvent.DATA_REMOVED);
159 }
160 if (info.isEmpty())
161 {
162 removeCache(id);
163 }
164 }
165 }
166
167 /**
168 * Removes all PCClass objects from the list of PCClass objects stored in

Callers

nothing calls this directly

Calls 7

getClassInfoMethod · 0.95
containsClassMethod · 0.95
setLevelMethod · 0.95
removeClassMethod · 0.95
isEmptyMethod · 0.95
removeCacheMethod · 0.80

Tested by

no test coverage detected