(BonusObj bo, boolean shortForm)
| 1052 | } |
| 1053 | |
| 1054 | public String getBonusContext(BonusObj bo, boolean shortForm) |
| 1055 | { |
| 1056 | final StringBuilder sb = new StringBuilder(50); |
| 1057 | |
| 1058 | boolean bEmpty = true; |
| 1059 | sb.append('['); |
| 1060 | if (bo.hasPrerequisites()) |
| 1061 | { |
| 1062 | for (Prerequisite p : bo.getPrerequisiteList()) |
| 1063 | { |
| 1064 | if (!bEmpty) |
| 1065 | { |
| 1066 | sb.append(','); |
| 1067 | } |
| 1068 | sb.append(p.getDescription(shortForm)); |
| 1069 | bEmpty = false; |
| 1070 | } |
| 1071 | } |
| 1072 | |
| 1073 | String type = bo.getTypeString(); |
| 1074 | if (!type.isEmpty()) |
| 1075 | { |
| 1076 | if (!shortForm) |
| 1077 | { |
| 1078 | if (!bEmpty) |
| 1079 | { |
| 1080 | sb.append('|'); |
| 1081 | } |
| 1082 | sb.append("TYPE="); |
| 1083 | bEmpty = false; |
| 1084 | } |
| 1085 | if (!shortForm || sb.charAt(sb.length() - 1) == '[') |
| 1086 | { |
| 1087 | sb.append(type); |
| 1088 | bEmpty = false; |
| 1089 | } |
| 1090 | } |
| 1091 | |
| 1092 | // |
| 1093 | // If there is nothing shown in between the [], then show the Bonus's |
| 1094 | // type |
| 1095 | // |
| 1096 | if (!bEmpty) |
| 1097 | { |
| 1098 | sb.append('|'); |
| 1099 | } |
| 1100 | sb.append(getSourceString(bo)); |
| 1101 | sb.append(']'); |
| 1102 | |
| 1103 | return sb.toString(); |
| 1104 | } |
| 1105 | |
| 1106 | private String getSourceString(BonusObj bo) |
| 1107 | { |
no test coverage detected