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

Method appendEquipmentLines

code/src/java/pcgen/io/PCGVer2Creator.java:1218–1265  ·  view source on GitHub ↗
(StringBuilder buffer)

Source from the content-addressed store, hash-verified

1216 }
1217
1218 private void appendEquipmentLines(StringBuilder buffer)
1219 {
1220 List<Equipment> eqsorted = thePC.getEquipmentMasterList();
1221 Collections.sort(eqsorted);
1222 for (final Equipment eq : eqsorted)
1223 {
1224 buffer.append(IOConstants.TAG_EQUIPNAME).append(':');
1225 buffer.append(EntityEncoder.encode(eq.getName()));
1226 buffer.append('|');
1227 buffer.append(IOConstants.TAG_OUTPUTORDER).append(':');
1228 buffer.append(eq.getOutputIndex());
1229 buffer.append('|');
1230 buffer.append(IOConstants.TAG_COST).append(':');
1231 buffer.append(eq.getCost(thePC));
1232 buffer.append('|');
1233 buffer.append(IOConstants.TAG_WT).append(':');
1234 buffer.append(eq.getWeight(thePC));
1235 buffer.append('|');
1236 buffer.append(IOConstants.TAG_QUANTITY).append(':');
1237 buffer.append(eq.qty());
1238
1239 final String note = eq.getNote();
1240 if (note != null)
1241 {
1242 buffer.append('|');
1243 buffer.append(IOConstants.TAG_NOTE).append(':');
1244 buffer.append(eq.getNote());
1245 }
1246
1247 final String customization = eq.formatSaveLine('$', '=').trim();
1248 final int delimiterIndex = customization.indexOf('$');
1249
1250 if ((!customization.isEmpty()) && (delimiterIndex >= 0))
1251 {
1252 buffer.append('|');
1253 buffer.append(IOConstants.TAG_CUSTOMIZATION).append(':');
1254 buffer.append('[');
1255 buffer.append(IOConstants.TAG_BASEITEM).append(':');
1256 buffer.append(EntityEncoder.encode(customization.substring(0, delimiterIndex)));
1257 buffer.append('|');
1258 buffer.append(IOConstants.TAG_DATA).append(':');
1259 buffer.append(EntityEncoder.encode(customization.substring(delimiterIndex + 1)));
1260 buffer.append(']');
1261 }
1262
1263 buffer.append(IOConstants.LINE_SEP);
1264 }
1265 }
1266
1267 private void appendEquipmentSetLines(StringBuilder buffer)
1268 {

Callers 1

createPCGStringMethod · 0.95

Calls 14

encodeMethod · 0.95
getOutputIndexMethod · 0.80
qtyMethod · 0.80
trimMethod · 0.80
formatSaveLineMethod · 0.80
getNameMethod · 0.65
getCostMethod · 0.65
getWeightMethod · 0.65
indexOfMethod · 0.65
isEmptyMethod · 0.65
sortMethod · 0.45

Tested by

no test coverage detected