MCPcopy Create free account
hub / github.com/Card-Forge/forge / getNonAbilityText

Method getNonAbilityText

forge-game/src/main/java/forge/game/card/Card.java:2405–2437  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2403 // get the text that does not belong to a cards abilities (and is not really
2404 // there rules-wise)
2405 public final String getNonAbilityText() {
2406 final StringBuilder sb = new StringBuilder();
2407 final StringBuilder sbLong = new StringBuilder();
2408
2409 for (String keyword : getHiddenExtrinsicKeywords()) {
2410 sbLong.append(keyword).append("\r\n");
2411 }
2412 if (sb.length() > 0) {
2413 sb.append("\r\n");
2414 if (sbLong.length() > 0) {
2415 sb.append("\r\n");
2416 }
2417 }
2418 if (sbLong.length() > 0) {
2419 sbLong.append("\r\n");
2420 }
2421 sb.append(sbLong);
2422
2423 if (!mayPlay.isEmpty()) {
2424 PlayerCollection players = new PlayerCollection();
2425 for (CardPlayOption o : mayPlay.values()) {
2426 if (getController() == o.getPlayer() || o.grantsZonePermissions())
2427 players.add(o.getPlayer());
2428 }
2429 if (!players.isEmpty()) {
2430 sb.append("May be played by: ");
2431 sb.append(Lang.joinHomogenous(players));
2432 sb.append("\r\n");
2433 }
2434 }
2435
2436 return sb.toString();
2437 }
2438
2439 // convert a keyword list to the String that should be displayed in game
2440 private String keywordsToText(final Collection<KeywordInterface> keywords) {

Callers

nothing calls this directly

Calls 11

getControllerMethod · 0.95
joinHomogenousMethod · 0.95
lengthMethod · 0.80
valuesMethod · 0.80
grantsZonePermissionsMethod · 0.80
isEmptyMethod · 0.65
getPlayerMethod · 0.65
addMethod · 0.65
appendMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected