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

Method appendSkillLines

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

Source from the content-addressed store, hash-verified

1948 * ###############################################################
1949 */
1950 private void appendSkillLines(StringBuilder buffer)
1951 {
1952 List<Skill> skillList = new ArrayList<>(charDisplay.getSkillSet());
1953 Collections.sort(skillList);
1954 for (Skill skill : skillList)
1955 {
1956 Integer outputIndex = thePC.getSkillOrder(skill);
1957 if ((thePC.getRank(skill).doubleValue() > 0) || (outputIndex != null && outputIndex != 0))
1958 {
1959 buffer.append(IOConstants.TAG_SKILL).append(':');
1960 buffer.append(EntityEncoder.encode(skill.getKeyName()));
1961
1962 buffer.append('|');
1963 if (outputIndex != null && outputIndex != 0)
1964 {
1965 buffer.append(IOConstants.TAG_OUTPUTORDER).append(':');
1966 buffer.append(outputIndex);
1967 buffer.append('|');
1968 }
1969
1970 for (PCClass pcc : thePC.getSkillRankClasses(skill))
1971 {
1972 if (pcc != null)
1973 {
1974 Double rank = thePC.getSkillRankForClass(skill, pcc);
1975 buffer.append(IOConstants.TAG_CLASSBOUGHT).append(':');
1976 buffer.append('[');
1977 buffer.append(IOConstants.TAG_CLASS).append(':');
1978 buffer.append(EntityEncoder.encode(pcc.getKeyName()));
1979 buffer.append('|');
1980 buffer.append(IOConstants.TAG_RANKS).append(':');
1981 buffer.append(rank);
1982 buffer.append('|');
1983 buffer.append(IOConstants.TAG_COST).append(':');
1984 buffer.append(Integer.toString(thePC.getSkillCostForClass(skill, pcc).getCost()));
1985 buffer.append('|');
1986 buffer.append(IOConstants.TAG_CLASSSKILL).append(':');
1987 buffer.append((thePC.isClassSkill(pcc, skill)) ? 'Y' : 'N');
1988 buffer.append(']');
1989 }
1990 }
1991
1992 for (String assoc : thePC.getAssociationList(skill))
1993 {
1994 buffer.append('|');
1995 buffer.append(IOConstants.TAG_ASSOCIATEDDATA).append(':');
1996 buffer.append(EntityEncoder.encode(assoc));
1997 }
1998
1999 appendLevelAbilityInfo(buffer, skill);
2000
2001 buffer.append(IOConstants.LINE_SEP);
2002 }
2003 }
2004 }
2005
2006 private void appendSpeechPatternLine(StringBuilder buffer)
2007 {

Callers 1

createPCGStringMethod · 0.95

Calls 15

encodeMethod · 0.95
getSkillOrderMethod · 0.80
doubleValueMethod · 0.80
getSkillRankClassesMethod · 0.80
getSkillRankForClassMethod · 0.80
getSkillCostForClassMethod · 0.80
getKeyNameMethod · 0.65
toStringMethod · 0.65
getCostMethod · 0.65
getSkillSetMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected