use of pcgen.cdom.helper.Capacity in project pcgen by PCGen.
the class Equipment method updateContainerCapacityString.
/**
* Creates the containerCapacityString from children of this object
*/
private void updateContainerCapacityString() {
final StringBuilder tempStringBuilder = new StringBuilder(100);
boolean comma = false;
BigDecimal weightCap = get(ObjectKey.CONTAINER_WEIGHT_CAPACITY);
if (weightCap != null && !Capacity.UNLIMITED.equals(weightCap)) {
tempStringBuilder.append(weightCap).append(' ').append(Globals.getGameModeUnitSet().getWeightUnit());
comma = true;
}
List<Capacity> capacity = getListFor(ListKey.CAPACITY);
if (capacity != null) {
for (Capacity c : capacity) {
if (comma) {
tempStringBuilder.append(", ");
comma = false;
}
BigDecimal capValue = c.getCapacity();
if (!Capacity.UNLIMITED.equals(capValue)) {
tempStringBuilder.append(capValue).append(' ');
tempStringBuilder.append(c.getType());
comma = true;
} else if (c.getType() != null) {
comma = true;
tempStringBuilder.append(c.getType());
}
}
}
containerCapacityString = tempStringBuilder.toString();
}
Aggregations