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

Method appendDeityLine

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

Source from the content-addressed store, hash-verified

985 * ###############################################################
986 */
987 private void appendDeityLine(StringBuilder buffer)
988 {
989 final Deity aDeity = (Deity) ChannelUtilities.readControlledChannel(
990 charDisplay.getCharID(), CControl.DEITYINPUT);
991 if (aDeity != null)
992 {
993
994 buffer.append(IOConstants.TAG_DEITY).append(':');
995 buffer.append(EntityEncoder.encode(aDeity.getKeyName()));
996
997 /*
998 * currently unused information
999 *
1000 * author: Thomas Behr 09-09-02
1001 */
1002 buffer.append('|');
1003 buffer.append(IOConstants.TAG_DEITYDOMAINS).append(':');
1004 buffer.append('[');
1005
1006 String del = Constants.EMPTY_STRING;
1007
1008 for (CDOMReference<Domain> ref : aDeity.getSafeListMods(Deity.DOMAINLIST))
1009 {
1010 for (Domain d : ref.getContainedObjects())
1011 {
1012 buffer.append(del);
1013 buffer.append(IOConstants.TAG_DOMAIN).append(':');
1014 buffer.append(EntityEncoder.encode(d.getKeyName()));
1015 del = "|"; //$NON-NLS-1$
1016 }
1017 }
1018
1019 buffer.append(']');
1020
1021 buffer.append('|');
1022 buffer.append(IOConstants.TAG_ALIGNALLOW).append(':');
1023 //TODO Need to clean this up?
1024 for (final Description desc : aDeity.getSafeListFor(ListKey.DESCRIPTION))
1025 {
1026 buffer.append('|');
1027 buffer.append(IOConstants.TAG_DESC).append(':');
1028 buffer.append(desc.getPCCText());
1029 }
1030
1031 buffer.append('|');
1032 buffer.append(IOConstants.TAG_DEITYFAVWEAP).append(':');
1033 buffer.append('[');
1034
1035 List<CDOMReference<WeaponProf>> dwp = aDeity.getListFor(ListKey.DEITYWEAPON);
1036 if (dwp != null)
1037 {
1038 del = Constants.EMPTY_STRING;
1039 for (CDOMReference<WeaponProf> ref : dwp)
1040 {
1041 buffer.append(del);
1042 buffer.append(IOConstants.TAG_WEAPON).append(':');
1043 buffer.append(EntityEncoder.encode(ref.getLSTformat(false)));
1044 del = "|"; //$NON-NLS-1$

Callers 1

createPCGStringMethod · 0.95

Calls 12

readControlledChannelMethod · 0.95
encodeMethod · 0.95
getSafeListModsMethod · 0.80
getCharIDMethod · 0.65
getKeyNameMethod · 0.65
getContainedObjectsMethod · 0.65
getSafeListForMethod · 0.65
getListForMethod · 0.65
getLSTformatMethod · 0.65
getMethod · 0.65
appendMethod · 0.45
getPCCTextMethod · 0.45

Tested by

no test coverage detected