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

Method getNewChildId

code/src/java/pcgen/core/PlayerCharacter.java:7232–7245  ·  view source on GitHub ↗

Identify a new id (only the final number in the path) for a child equipment set. The id is guarantyeed to be unique and have no siblings with higher ids. @param pid The parent path. @return New id for a child node

(String pid)

Source from the content-addressed store, hash-verified

7230 * @return New id for a child node
7231 */
7232 public int getNewChildId(String pid)
7233 {
7234 int newID = 0;
7235 for (EquipSet es : getEquipSet())
7236 {
7237 if (es.getParentIdPath().equals(pid) && (es.getId() > newID))
7238 {
7239 newID = es.getId();
7240 }
7241 }
7242
7243 ++newID;
7244 return newID;
7245 }
7246
7247 public EquipSet addEquipToTarget(final EquipSet eSet, final Equipment eqTarget, String locName, final Equipment eqI,
7248 Float newQty)

Callers 2

getNewIdPathMethod · 0.95
sortEquipmentMethod · 0.80

Calls 4

getEquipSetMethod · 0.95
getParentIdPathMethod · 0.80
equalsMethod · 0.65
getIdMethod · 0.65

Tested by

no test coverage detected