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

Method toString

forge-game/src/main/java/forge/game/combat/Combat.java:128–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

126 }
127
128 @Override
129 public String toString() {
130 StringBuilder sb = new StringBuilder();
131 for (GameEntity defender : attackableEntries.get()) {
132 CardCollection attackers = getAttackersOf(defender);
133 if (attackers.isEmpty()) {
134 continue;
135 }
136 sb.append(defender);
137 sb.append(" is being attacked by:\n");
138 for (Card attacker : attackers) {
139 sb.append(" ").append(attacker).append("\n");
140 for (Card blocker : getBlockers(attacker)) {
141 sb.append(" ... blocked by: ").append(blocker).append("\n");
142 }
143 }
144 }
145 if (sb.length() == 0) {
146 return "<no attacks>";
147 }
148 return sb.toString();
149 }
150
151 public void endCombat() {
152 //backup attackers and blockers

Callers 2

validateBlocksMethod · 0.45

Calls 6

getAttackersOfMethod · 0.95
getBlockersMethod · 0.95
lengthMethod · 0.80
getMethod · 0.65
isEmptyMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected